06.05.2014, 13:02
pawn Код:
stock IsVehicleOccupied(vehicleid)
{
for(new i =0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i,vehicleid))
{
return 1;
}
}
return 0;
}
CMD:rv(playerid,params[])
{
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,-4,"{FF9900}Only Admin Level 3 To Use Command!!!");
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(!IsVehicleOccupied(i))
{
SetVehicleToRespawn(GetPlayerVehicleID(i));
}
}
SendClientMessageToAll(0xFFFFFFFF,"{FF0000}Administrator Respawn Vehicle!!!");
SendClientMessage(playerid,0xFFFFFFFF,"{FF9900}You Respawn Vehicle!!!!");
return 1;
}
Try that code. It will work if the admin level is 3 or above, and will only respawn unoccupied vehicles.