Liberty Unleashed

Scripting => Script Help => Topic started by: Beary on January 18, 2015, 12:51:13 am

Title: Help my Script !
Post by: Beary 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!
Title: Re: Help my Script !
Post by: Vortrex 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)
Title: Re: Help my Script !
Post by: Beary 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?
Title: Re: Help my Script !
Post by: Vortrex 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 )
Title: Re: Help my Script !
Post by: Beary 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 :)