29.08.2010, 18:09
hi i need a ban cmd please
if(strcmp("/ban", cmd, true) == 0) { tmp = strtok(cmdtext, idx); if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "ERROR: You can't ban yourself!"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "ERROR: No player with such id!"); cmdid = strval(tmp); format(string, sizeof(string), "NOTICE: %s have banned %s from the server.", prname, idname); SendClientMessageToAll(yellow, string); print(string); Ban(cmdid); return 1; }
Код:
if(strcmp("/ban", cmd, true) == 0) { tmp = strtok(cmdtext, idx); if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "ERROR: You can't ban yourself!"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "ERROR: No player with such id!"); cmdid = strval(tmp); format(string, sizeof(string), "NOTICE: %s have banned %s from the server.", prname, idname); SendClientMessageToAll(yellow, string); print(string); Ban(cmdid); return 1; } |