SA-MP Forums Archive
Vehicle enter help.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle enter help.. (/showthread.php?tid=329668)



Vehicle enter help.. - viddo - 29.03.2012

How can i make some cars unenterable like if the
Код:
if(IsOnTutorial[playerid] == 1)
is not assigned, then the player cant enter the vehicle?


Re: Vehicle enter help.. - Zhao - 29.03.2012

Use one of the following callbacks:
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
https://sampwiki.blast.hk/wiki/OnPlayerStateChange

Then use the following function in that if statement:
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle


Re: Vehicle enter help.. - park4bmx - 29.03.2012

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsOnTutorial[playerid] == 1) ClearAnimations(playerid); //wiil stop the player from entering the vehicle !
}



Re: Vehicle enter help.. - viddo - 30.03.2012

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsOnTutorial[playerid] == 1) ClearAnimations(playerid); //wiil stop the player from entering the vehicle !
}
I want it to stop him from entering a specific vehicle lets say i made 3 bikes at airport and i want them locked for any player who is not on tutorial


Re: Vehicle enter help.. - Reklez - 30.03.2012

put this OnPlayerStateChange

pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
    if(IsOnTutorial[playerid] == 0) RemovePlayerFromVehicle(playerid);
    //other codes
}
if player is not in tutorial he will remove from vehicle.


Re: Vehicle enter help.. - viddo - 30.03.2012

I made it and added the id of the bmx that i added in the airport, but when i did it all the bmx's are unenterable..