28.06.2012, 06:35
pawn Код:
command(banname,playerid,params[])
{
if(Stats[playerid][AdminLevel] >= 5) {
new name[MAX_PLAYER_NAME], namestring[45], string[128], sendername[MAX_PLAYER_NAME];
if(unformat(params,"s[MAX_PLAYER_NAME]",name)) return SendClientMessage(playerid, COLOR_WHITE,"{777777}[SYNTAX]{FFFFFF} /BanName [Player Name]");
format(namestring, sizeof(namestring), "/Users2/%s.ini", name);
if(dini_Exists(namestring)) {
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{00FF00}[SERVER]{FFFFFF} Admin %s has banned the account named %s.", sendername, namestring);
SendClientMessageToAll(COLOR_WHITE, string);
dini_IntSet(namestring, "Banned", 1);
} else {
format(string, sizeof(string), "{FF0000}[ERROR]{FFFFFF} %s is not a registered account.", namestring);
SendClientMessage(playerid, COLOR_WHITE, string);
}
} else {
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR]{FFFFFF} You can't use this command, stop trying to be cool.");
}
return 1;
}
Hope I helped.