10.05.2011, 17:44
Код:
if (strcmp(cmd, "/spban", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spban(Special Person Ban) [playerid/PartOfName] [reason]"); return 1; } if (PlayerInfo[playerid][pAge] == 310518 ) { new year, month,day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result)); BanLog(string); new ip[128]; GetPlayerIp(giveplayerid,ip,128); format(string, sizeof(string), "Banned Player's IP: %s", ip); ABroadCast(COLOR_YELLOW,string,1); strmid(PlayerInfo[giveplayerid][pBanReason], result, 0, strlen(result), 255); PlayerInfo[giveplayerid][pBanned] = 1; PlayerInfo[giveplayerid][pBans] += 1; Ban(giveplayerid); return 1; } } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1;
If you got The age of: 310518, And you type /spban [user id], Than it should ban that person.
So with this command you dont have to be admin to ban, But you need an sertain Age amouth.
But i dont understand what i did wrong.