Need Scripts :|
#2

The first part is the "checker":

Код:
forward TimerSlap(playerid);
public TimerSlap(playerid)
{
	if(GetPlayerVehicleSeat(playerid) > 0)//If the player is a passenger
	{
		for(new i = 0; i < MAX_PLAYERS; i++) //Loops through all players
	    		if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) 
				return 1;


		//If did not found the driver, the passenger get slapped
		RemovePlayerFromVehicle(playerid);//Removing player from vehicle
		SendClientMessage(playerid, -1, "* There is no Driver in This Car ! Use F . ");
	}
}
You can use this code as a infinite timer and start it when OnGameModeInit get called.

The other way is: the "checker" get called only when the driver got out of the car or when anyother player enter in a vehicle.
Reply


Messages In This Thread
Need Scripts :| - by PoniStar - 02.09.2018, 14:18
Re: Need Scripts :| - by iHollyZinhO - 02.09.2018, 14:34
Re: Need Scripts :| - by PoniStar - 02.09.2018, 14:49
Re: Need Scripts :| - by iHollyZinhO - 02.09.2018, 14:53
Re: Need Scripts :| - by PoniStar - 02.09.2018, 14:59
Re: Need Scripts :| - by iHollyZinhO - 02.09.2018, 15:04
Re: Need Scripts :| - by PoniStar - 02.09.2018, 15:16
Re: Need Scripts :| - by iHollyZinhO - 02.09.2018, 15:20
Re: Need Scripts :| - by PoniStar - 02.09.2018, 15:32
Re: Need Scripts :| - by iHollyZinhO - 02.09.2018, 15:35
Re: Need Scripts :| - by PoniStar - 02.09.2018, 15:50

Forum Jump:


Users browsing this thread: 1 Guest(s)