18.08.2013, 18:56
pawn Код:
CMD:unban(playerid, params[])
{
new LuckyGuy[MAX_PLAYER_NAME + 6 + 4];
if(PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playerid, COLOR_RED, "Error: "COL_WHITE" You're not a high enough Administrator.");
if(sscanf(params, "s[24]", LuckyGuy)) return SendClientMessage(playerid, COLOR_RED, "Error: "COL_WHITE"/unban [Name] (Example: Jammie Dodger)");
format(LuckyGuy, sizeof(LuckyGuy), PATH, LuckyGuy);
if(!fexist(LuckyGuy)) return SendClientMessage(playerid, COLOR_RED, "Error: Player doesn't exist! (Tips: Don't use _ | Example Jammie Dodger)");
new INI:File = INI_Open(LuckyGuy);
print("File opened");
INI_SetTag(File, "Statistics");
print("SetTag");
INI_WriteInt(File, "Banned", 0);
print("Set banned");
INI_Close(File);
print("Closed File.");
new File:PlayerIP = fopen(LuckyGuy, io_read);
new string[16 + 7],len;
while((len = fread(PlayerIP, string)))
if(strcmp(string, "IP = ", true)==0)
{
string[len-2] = 0;
strdel(string,0,5);
break; // stop searching
}
format(LuckyGuy, sizeof(LuckyGuy), Ban_Path, string);
if(!fremove(LuckyGuy)) return SendClientMessage(playerid, COLOR_RED, "|-- Error: Account Deletion Failed!");
SendClientMessage(playerid, COLOR_GREEN, "Account Unbanned!");
return 1;
}
"/ban player name" 2 parameters? It says it's an unknown command.
E: This is the debug although it said it's an unknown command:
Код:
[19:53:48] File opened [19:53:48] SetTag [19:53:48] Set banned

