15.04.2019, 22:13
use this Code
PHP Code:
CMD:respawncars(playerid, params[])
{
//check if the player is a admin
LevelCheck(playerid, 4);
for(new cars; cars < MAX_VEHICLES; cars++)
{
LOOP_PLAYERS(i)
{
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
if(GetPlayerVehicleID(i) == cars)
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if(GetPlayerGAdminLevel(playerid) < GetPlayerGAdminLevel(i))
{
SetVehicleToRespawn(cars);
}
}
else SetVehicleToRespawn(cars);
}
else SetVehicleToRespawn(cars);
}
}
GameTextForAll("~b~~h~~h~~h~Vehicles respawned", 5000, 3);
new string[144];
format(string, sizeof(string), "You respawned all vehicles.", ReturnPlayerName(playerid), playerid);
SendClientMessageToAll(COLOR_HOT_PINK, string);
return 1;
}