02.03.2009, 17:20
Код:
if(strcmp(cmd, "/banip", true) == 0) { tmp = strtok(cmdtext, idx); giveplayerid = strval(tmp); new playerip[16]; strmid(playerip, tmp, 0, strlen(tmp)); new string2[256]; if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /banip [ip]"); return 1; } new playa; if(IsStringAName(tmp)) { playa = GetPlayerID(tmp); } else { playa = strval(tmp); } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if (PlayerInfo[playerid][pAdmin] >= 1) { format(string, sizeof(string), "AdmCmd: %s Has been banned by %s", playerip, sendername); SendClientMessageToAll(COLOR_RED, string); format(string2, sizeof(string2), "banip %s", playerip); SendRconCommand(string2); } else { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); } return 1; }