06.05.2010, 13:01
Hmm i made a /ban command and now i wanted to ban myself(LOLxD) but it dont work
Maybe someone could help me
Maybe someone could help me
Quote:
if(strcmp(cmd, "/ban", true) == 0) { if(PlayerInfo[playerid][Adminlevel] >= 3) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]"); new player1 = strval(tmp); new Reason[120]; strmid(Reason,cmdtext,strlen(cmd)+strlen(tmp)+2,st rlen(cmdtext)); if(IsPlayerConnected(player1)) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string,sizeof(string),"You have banned %s from the server!(Reason: %s)", playername, Reason); SendClientMessage(playerid, COLOR_GREEN, string); format(string,sizeof(string),"Administrator %s has banned %s from the server!(Reason: %s)",adminname, playername, Reason); SendClientMessageToAll(COLOR_GREEN, string); printf("%s has banned %s from the server !(Reason: %s)",adminname, playername, Reason); Ban(player1); } else { SendClientMessage(playerid, COLOR_RED, "This player is not connected"); } return 1; } |