23.01.2011, 13:32
Hello, so, I just can't get this working, and I see nothing wrong in this code.
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?
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;
}
Any ideas why this doesn't work?