Eject if player is driver. Car locks
#1

Hello there, Me and a friend are making a new gamemode but I have a li'l question.

For the vehicle locks I use this code:
Code:
{
	if(vteam[GetPlayerVehicleID(playerid)] == 1)
	{
  		if(PlayerInfo[playerid][Fmember] == 1 || PlayerInfo[playerid][Fleader] == 1)
  		{
    		SendClientMessage(playerid, 0x999999AA, "U started this police car!");
  		}
		else
		{
    		RemovePlayerFromVehicle(playerid);
    		TogglePlayerControllable(playerid, 1);
    		SendClientMessage(playerid, 0x999999AA, "You don't have the key of this vehicle.");
  		}
      }
	}
But now, Even passengers who aren't Fmember == 1 get ejected, How do I make it so that only the driver gets ejected from the car when he is no fMember 1?
Reply
#2

pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    // stuff here
}
Reply
#3

pawn Code:
if(vteam[GetPlayerVehicleID(playerid)] == 1) {
    if(PlayerInfo[playerid][Fmember] == 1 || PlayerInfo[playerid][Fleader] == 1) SendClientMessage(playerid, 0x999999AA, "You started this police car!");
    else {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
            SendClientMessage(playerid, 0x999999AA, "You don't have the key of this vehicle.");
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)