31.01.2011, 07:23
pawn Код:
CMD:respawnall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command.");
for(new v=0; v<MAX_VEHICLES; v++)
{
if(!IsVehicleOccupied(v))
{
new string[128];
SetVehicleToRespawn(v);
format(string, 256, "[AdmCmd] %s has respawned all unoccupied vehicles", GetPlayerNameEx(playerid));
SendGlobalMessage(COLOR_ADMIN, string);
}
}
return 1;
}
pawn Код:
forward IsVehicleOccupied(vehicleid);
public IsVehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}