Respawn all vehicles command
#1

This cmd respawns all cars,but it also respawns atached trailers when truckers are doing a job.How can i set it to Check if trailer is atached then respawn it if its conected?

Code:
COMMAND:opetvozila(playerid,params[])
{
	if (APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] > 6)
	{
		for (new j = 1; j <= MAX_VEHICLES; j++)
		{
			if (GetVehicleModel(j) == 0) continue;
			new moneys1 = 0;
			for (new i = 0; i < MAX_PLAYERS; i++)
			{
				if (!IsPlayerInVehicle(i, j)) continue;
				moneys1 ++;
				break;
			}
			if (moneys1 == 0)
			{
				SetVehicleToRespawn(j);
			}
		}
		SendClientMessageToAll(0xFFFFFF, "Vozila su opet ucitana. Mozete ih naci na mjestu gdje su parkirani.");
	}
	else return 0;
	return 1;
}
Reply
#2

http://forum.sa-mp.com/showpost.php?...55&postcount=6

Just change CAR_AMOUNT to MAX_VEHICLES or GetVehiclePoolSize()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)