SA-MP Forums Archive
SAPD vehicles problem. - 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)
+--- Thread: SAPD vehicles problem. (/showthread.php?tid=436679)



SAPD vehicles problem. - lQs - 12.05.2013

Hey, i have something like this:

pawn Код:
if( GetVehicleModel(GetPlayerVehicleID( playerid )) == 596 )
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            ClearAnimations(playerid);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "You are not in the BCPD!");
        }
    }
    if( GetVehicleModel(GetPlayerVehicleID( playerid )) == 523 )
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            ClearAnimations(playerid);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "You are not in the BCPD!");
        }
    }
But it works for passanger seat too, how i can change that?


Re: SAPD vehicles problem. - Lordzy - 12.05.2013

You must get the player's state and see if the player is in driver state so that it will work for the driver only.
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if( GetVehicleModel(GetPlayerVehicleID( playerid )) == 596 )
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            ClearAnimations(playerid);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "You are not in the BCPD!");
        }
    }
    if( GetVehicleModel(GetPlayerVehicleID( playerid )) == 523 )
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            ClearAnimations(playerid);
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_RED, "You are not in the BCPD!");
        }
    }
}



Re : SAPD vehicles problem. - yusei - 12.05.2013

PHP код:
if(PlayerInfo[playerid][pMember] != && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            
ClearAnimations(playerid);
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED"You are not in the BCPD!");
        } 
edit Lordz™ We post at the same time xD


Re: SAPD vehicles problem. - lQs - 12.05.2013

Working, thanks a lot!