respawned with occupied vehicle?
#1

I made some commands, the commands to respawn factions vehicle, but the problem is, It respawned the occupied faction vehicle too, so when players are driving, their vehicle dissapears when i do /respawnarmyveh.
Can someone fix it for me?
The /respawnarmyveh
Код:
CMD:respawnarmy(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 1)
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "Dibutuhkan admin LVL 1+");
	}
	else
	{
		for(new x;x<sizeof(ARMYVehicles);x++)
		{
		    if(!IsVehicleOccupied(x))
		    {
	 	    	SetVehicleToRespawn(ARMYVehicles[x]);
			}
		}
		SendClientMessageToAll(COLOR_REALRED,"[Information] {FFFFFF}Kendaraan faction ARMY telah Direspawn.");
	}
	return 1;
}
Stock IsVehicleOccupied
Код:
stock IsVehicleOccupied(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
		{
            return 1;
		}
	}
    return 0;
}
Reply


Messages In This Thread
respawned with occupied vehicle? - by Dirda - 15.02.2018, 09:46
Re: respawned with occupied vehicle? - by PepsiCola23 - 15.02.2018, 10:39
Re: respawned with occupied vehicle? - by Eoussama - 15.02.2018, 10:44
Re: respawned with occupied vehicle? - by Mugala - 15.02.2018, 10:54
Re: respawned with occupied vehicle? - by Dirda - 16.02.2018, 04:29
Re: respawned with occupied vehicle? - by PepsiCola23 - 16.02.2018, 08:58
Re: respawned with occupied vehicle? - by RogueDrifter - 16.02.2018, 09:13
Re: respawned with occupied vehicle? - by MEW273 - 16.02.2018, 09:40
Re: respawned with occupied vehicle? - by RogueDrifter - 16.02.2018, 09:51
Re: respawned with occupied vehicle? - by Astralis - 16.02.2018, 09:56

Forum Jump:


Users browsing this thread: 1 Guest(s)