Only Pilots Can Fly
#1

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?
Reply
#2

do it in OnPlayerStateChange
Reply
#3

Works, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)