Forbidden vehicles
#1

How can i eject a player when he enters to a forbidden vehicle(Hydra, rhino,hunter,rc-plane)?
I tryed to do that using OnPlayerEnterVehicle() but i am using a vehicle spawner so the OnPlayerEnterVehicle wont work..
Can someone help me?
Reply
#2

You mean a instant spawner? Like for example, /hydra and you're in the Hydra?
Reply
#3

Quote:
Originally Posted by RTR12
Посмотреть сообщение
You mean a instant spawner? Like for example, /hydra and you're in the Hydra?
No
I want to when a player enters to those vehicles: Hydra,rhino,hunter,rc-plane will be ejected with a message: This vehicle is only allowed for admins or something like this.
Is this possible?
Reply
#4

pawn Код:
new acar;

//under gamemodeinit
 acar = createvehicle(520,2484.3054,-1655.0886,13.1036,90.8565,44,16,900);

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == acar )
        {
            if(!IsPlayerAdmin(playerid))
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)