Author Topic: Help my Script !  (Read 7037 times)

Beary

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-5
    • View Profile
Help my Script !
« on: January 18, 2015, 12:51:13 am »
Everybody is good, I have a question to ask. :)
When I get onPlayerEnteredVehicle
I want to get:
If (pVehicle.Model = VEH_POLICE)
MessagePlayer ("You entered Police Car.", player);
But he is wrong, I'm not sure if (pVehicle.Model = VEH_POLICE) wrote is correct
How do I write the script? Please help me!

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-74
    • View Profile
Re: Help my Script !
« Reply #1 on: January 18, 2015, 04:30:24 am »
You are missing a second equals sign next to the one you have.

It should be written as:
If (pVehicle.Model == VEH_POLICE)

Beary

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-5
    • View Profile
Re: Help my Script !
« Reply #2 on: January 18, 2015, 05:40:10 am »
You are missing a second equals sign next to the one you have.

It should be written as:
If (pVehicle.Model == VEH_POLICE)

I changed But I don't work here I'm not too will use BBS system

-------------------------------------------------------------------------------

function onPlayerEnteredVehicle( player, vehicle, seat )
{
if (pVehicle.Model == VEH_POLICE)
{
     MessagePlayer( "Enter police car.", player );
}
     return 1;
}-------------------------------------------------------------------------------

Maybe I am wrong?

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-74
    • View Profile
Re: Help my Script !
« Reply #3 on: January 18, 2015, 06:24:18 am »
The problem with it now, is there isn't anything defined as "pVehicle".

Since you used "vehicle" (without the p) in your function, then just use that.

if( vehicle.Model == VEH_POLICE )

Beary

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-5
    • View Profile
Re: Help my Script !
« Reply #4 on: January 19, 2015, 01:16:27 am »
The problem with it now, is there isn't anything defined as "pVehicle".

Since you used "vehicle" (without the p) in your function, then just use that.

if( vehicle.Model == VEH_POLICE )

Thank :)

 

© Liberty Unleashed Team.