18.06.2014, 09:48
Why It Always Says: Account Doesn't Exist In These Codes:
But The Weird Is I See In The Server Logs: write this tag: Data,
But In The Player File,I Still See Banned = 1 And I Want Make It 0 (I Mean That I Want To Unban Him).
pawn Код:
COMMAND:unban(playerid, params[])
{
new player[24], String[32], Message9[128], PNAME10[MAX_PLAYER_NAME];
if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, 0xFF0000AA, "You Are Not An Adminstrator!");
if (sscanf(params, "s[24]", player)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /unban <fullplayername>");
format(String, sizeof(String), "/Users/%s.ini", player);
GetPlayerName(playerid, PNAME10, MAX_PLAYER_NAME);
if(fexist(String))
{
if(strval(INI_Get(String,"Banned")) == 1)
{
new INI:File = INI_Open(String);
INI_SetTag(File,"data");
INI_WriteInt(File, "Banned", 0);
INI_Close(File);
if(PlayerInfo[playerid][pAdmin] > 0)
{
switch(PlayerInfo[playerid][pAdmin])
{
case 1: AdmRank = "Trial Moderator";
case 2: AdmRank = "Moderator";
case 3: AdmRank = "Master Moderator";
case 4: AdmRank = "Trial Administrator";
case 5: AdmRank = "Administrator";
case 6: AdmRank = "Master Adminstrator";
case 7: AdmRank = "Head Adminstrator";
case 8: AdmRank = "Trusted Adminstrator";
case 9: AdmRank = "Co-Owner";
case 10: AdmRank = "Owner";
}
format(Message9, sizeof (Message9), "Successfully Unbanned The Account Of: %s.",player);
SendClientMessage(playerid, 0xFFC400AA, Message9);
format(Message9, sizeof (Message9), "The {FF0000}%s {FFEA00}%s (%d) Has Unbanned The Account Of: %s.",AdmRank, PNAME10, playerid, player);
SendClientMessageToAll(0xFFEA00AA, Message9);
}
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 0)
{
format(Message9, sizeof(Message9), "[ADM] The {FF0000}%s {FF5900}%s (%d) Has Unbanned The Account Of %s.",AdmRank, PNAME10, playerid, player), SendClientMessage(i, 0xFF5900FF, Message9);
print(Message9);
}
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "This Account Is Not Banned!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "This Account Doesn't Exist!");
}
return 1;
}
But In The Player File,I Still See Banned = 1 And I Want Make It 0 (I Mean That I Want To Unban Him).