22.05.2013, 18:02
Код:
if(strcmp(cmd, "/vehdespawn", true) == 0 || strcmp(cmd, "/rav", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); return 1; } new bool:unwanted[CAR_AMOUNT]; for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } } for(new car = 1; car <= 268; car++) { if(!unwanted[car]) SetVehicleToRespawn(car); } GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Server action: "COL_RED"All unused vehicles were respawned by Administrator %s.", RemoveUnderScore(playerid)); SendClientMessageToAll(COLOR_RED,string); } return 1; }
if(PlayerInfo[playerid][pAdmin] < 1)
To;
if(PlayerInfo[playerid][pAdmin] < 0)
To make the command used by anyone, a higher number requires a higher admin level to use it