OnPlayerStateChange (RemovePlayerFromVehicle)
#1

Here is my script that i use to remove players from restricted vehicle, but if i go in any vehicle i get removed where i in SAPD or not.
Please help.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new vid = GetPlayerVehicleID(playerid);
    if(vid == sapd1 || vid == sapd2 vid == sapd3 || vid == sapd4 || Member[playerid] != 3)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, red, "You cannot enter this vehicle!");
    }
    }
    return 1;
}
Reply
#2

GetPlayerVehicleModel
Reply
#3

How to use that with my code?
Reply
#4

pawn Код:
new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
Reply
#5

do i need a stock or somthing?
Reply
#6

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        if(vid == sapd1 || vid == sapd2 vid == sapd3 || vid == sapd4 && Member[playerid] != 3)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, red, "You cannot enter this vehicle!");
        }
    }
    return 1;
}
Reply
#7

Thanks, it worked, since && means and and || means or, i think i had it wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)