20.12.2010, 17:04
Hi all,i maked this custom code for the ban function:
I need to add,when some admin ban a player,the name banned will be added to a file. (Ex: bannednames.txt)
Thanks.
Код:
dcmd_b(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] > 2) { new toplayerid, reason[ 128 ]; if (sscanf(params, "us[128]", toplayerid, reason)) { SendClientMessage(playerid, 0xAA3333AA, "Syntax Error: /b < Playerid > < Reason >"); return 1; } if (toplayerid == INVALID_PLAYER_ID) { SendClientMessage(playerid, 0xAA3333AA, "Input Error: Player is not connected or it is yourself."); return 1; } new banString[128], adminName[24], bannedName[24]; GetPlayerName(playerid, adminName, 24); GetPlayerName(toplayerid, bannedName, 24); format(banString, 128, "Player %s was banned by Administrator %s. Reason: %s.", bannedName, adminName, reason); SendClientMessageToAll(0xAA3333AA, banString); new str[100]; format(str,sizeof str,"0,4Player %s was banned by Administrator %s. Reason: %s", bannedName, adminName, reason); IRC_GroupSay(gGroupID, IRC_CHANNEL, str); BanLog(banString); Ban(toplayerid); } return 1; }
Thanks.