08.10.2014, 14:13
pawn Код:
CMD:oban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new targetname[24], filestring[79];
if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, -1, "Usage: /oban [Player Name]");
format(filestring, sizeof(filestring), "/Users/%s.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "Error: Incorrect player/name.");
else
{
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
INI_WriteInt(File, "Banned", 1);
INI_Close(File);
new done[128];
format(done, sizeof(done), "You have banned %s", targetname);
SendClientMessage(playerid,-1 , done);
}
}
else SendClientMessage(playerid, -1, "SERVER: Unknown command.");
return 1;
}