04.03.2014, 16:37
My friend, try this code:
pawn Код:
CMD:rac(playerid,params[])
{
if(PlayerInfo[playerid][LoggedIn] == 1)
{
if(PlayerInfo[playerid][Level] >= 4)
{
new string[128];
new bool:unwanted[MAX_VEHICLES];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerConnected(player) && IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!unwanted[cars]) SetVehicleToRespawn(cars);
}
format(string,sizeof(string),"Administrator %s has respawn all unused vehicles.",pName(playerid));
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i,blue,string);
}
}
}
else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
return 1;
}