SA-MP Forums Archive
OnPlayerStateChange (RemovePlayerFromVehicle) - 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: OnPlayerStateChange (RemovePlayerFromVehicle) (/showthread.php?tid=187575)



OnPlayerStateChange (RemovePlayerFromVehicle) - zack3021 - 03.11.2010

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;
}



Re: OnPlayerStateChange (RemovePlayerFromVehicle) - willsuckformoney - 03.11.2010

GetPlayerVehicleModel


Re: OnPlayerStateChange (RemovePlayerFromVehicle) - zack3021 - 03.11.2010

How to use that with my code?


Re: OnPlayerStateChange (RemovePlayerFromVehicle) - Conroy - 03.11.2010

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



Re: OnPlayerStateChange (RemovePlayerFromVehicle) - zack3021 - 03.11.2010

do i need a stock or somthing?


Re: OnPlayerStateChange (RemovePlayerFromVehicle) - The_Moddler - 03.11.2010

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;
}



Re: OnPlayerStateChange (RemovePlayerFromVehicle) - zack3021 - 04.11.2010

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