[HELP]Enter vehicle -
Tautwis - 03.01.2012
Hi. How can i make, that when the player tryes to enter a vehicle, but he can't do it.
On my GM, it's now, when i press enter, i enter the car, and then exit from it automaticly. How can i make, that the player won't be able to enter the car, without permissions. Thanks
Re: [HELP]Enter vehicle -
#Pwn. - 03.01.2012
Should the player in a Fraction?
Re: [HELP]Enter vehicle -
Tautwis - 03.01.2012
Yes
Re: [HELP]Enter vehicle -
#Pwn. - 03.01.2012
Which Fraction number?
Re: [HELP]Enter vehicle -
Wesley221 - 03.01.2012
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if( newstate == PLAYER_STATE_DRIVER )
{
if( /* to check if the player ISNT alowed */ )
{
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid, -1, "You are not allowed to enter this vehicle. " );
}
else
{
SendClientMessage( playerid, -1, "Welcome to the vehicle!" );
}
}
return 1;
}
That will do the trick. Just change the if statement
Re: [HELP]Enter vehicle -
Tautwis - 03.01.2012
Lets take for example faction number 1
EDIT:
Wesley221 - I want to make it without RemovePlayerFromVehicle
Re: [HELP]Enter vehicle -
Wesley221 - 03.01.2012
You want that the vehicle is locked, so he cant enter at all?
Re: [HELP]Enter vehicle -
Tautwis - 03.01.2012
No. Lets take for ex. police car. It's a faction car. So the player, who isn't working at police station, he wont be even able to enter the car. Like he press F (enter), and nothing happens. Do you get it ?
Re: [HELP]Enter vehicle -
#Pwn. - 03.01.2012
I think thats impossible :/
Re: [HELP]Enter vehicle -
Tautwis - 03.01.2012
If you think so, you very wrong. I saw this on many servers. I knew how to make it, but i forgot it... lol
Any helpers over here ?