Only Pilots Can Fly - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Only Pilots Can Fly (
/showthread.php?tid=215467)
Only Pilots Can Fly -
ExeC - 23.01.2011
Hello, so, I just can't get this working, and I see nothing wrong in this code.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == 425) //Hydra
{
if(IsPilot[playerid] == 1) //If pilot
{
return 1; //Works
}
else if(IsPilot[playerid] == 0) //If not pilot
{
RemovePlayerFromVehicle(playerid); //Remove from vehicle
SendClientMessage(playerid, 0xFEFEFEFF, "SERVER: {FF0000}Only pilot's can fly hunters!"); //Error message
}
}
return 1;
}
That should make that only pilots can fly hunter, but when I enter to a hydra, and I'm not pilot, it still allows me to enter it. Same, if I'm not pilot, it allows me to enter... Obviously.
Any ideas why this doesn't work?
Re: Only Pilots Can Fly -
iJumbo - 23.01.2011
do it in OnPlayerStateChange
Re: Only Pilots Can Fly -
ExeC - 23.01.2011
Works, thanks.