SAPD vehicles problem.
#1

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

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!");
        }
    }
}
Reply
#3

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
Reply
#4

Working, thanks a lot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)