Unban cmd
#1

I've problem with my /unban command :/

Well /ban adds "pSuspended = 1" to Player.ini file.

and I don't know what's wrong with my /unban cmd. It should change pSuspended to "0" but it doesn't. It even shows for me message "Player Is Not Banned"

/ban cmd :
pawn Код:
//-------------------------[Ban]------------------------------------------------
if(strcmp(cmd, "/ban", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /ban [playerid] [reason]");
return 1;
}
new playa = strval(tmp);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= &#39; '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /ban [playerid] [reason]");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[playerid][pRealAdmin] == 1)
{
SendClientMessage(playa, COLOR_YELLOW, "You were banned from the server");
SendClientMessage(playa, COLOR_GREEN, "===========================================================================");
format(string, sizeof(string), "Admin: %s Banned you",sendername);
SendClientMessage(playa, COLOR_RED, string);
format(string, sizeof(string), "Reason: %s", result);
SendClientMessage(playa, COLOR_RED, string);
SendClientMessage(playa, COLOR_GREEN, "===========================================================================");
SendClientMessage(playa, COLOR_YELLOW, "To appeal this ban, screenshot the information and visit http://www.tomsrp.mysmf.com[url=http://]");
format(string, sizeof(string), "Admin: %s Banned %s, Reason: %s",sendername, giveplayer, result);
printf("%s",string);
format(string, sizeof(string), "Admin: %s Banned %s, Reason: %s",sendername, giveplayer, result);
PlayerInfo[playerid][pSuspended] = 1;
SendClientMessageToAll(COLOR_RED, string);
Ban(playa);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
}
return 1;
}
/Unban command.

pawn Код:
//-------------------------[Unban]----------------------------------------------
if (strcmp(cmd, "/unban", true)==0)
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[playerid][pRealAdmin] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unban [playername]");
return 1;
}
if(!LoadPlayer(playerid,tmp))
{
return 1;
}
if(PlayerInfo[playerid][pSuspended] == 0)
{
SendClientMessage(playerid, COLOR_RED, "That player is not banned!");
return 1;
}
else
{
if(PlayerInfo[playerid][pSuspended] == 1)
{
PlayerInfo[playerid][pSuspended] = 0;
SavePlayer(playerid,tmp);
SendClientMessage(playerid, COLOR_DBLUE, "Player Un banned");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
}
return 1;
}

if (strcmp(cmd, "/unbanip", true)==0)
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 8 && PlayerInfo[playerid][pRealAdmin] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unban [IP]");
return 1;
}
format(string, sizeof(string), "unbanip %s", tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
}
return 1;
}
Help
Reply


Messages In This Thread
Unban cmd - by Minio1822 - 17.05.2010, 20:37
Re: Unban cmd - by NewTorran - 17.05.2010, 20:39
Re: Unban cmd - by Minio1822 - 17.05.2010, 20:41
Re: Unban cmd - by NewTorran - 17.05.2010, 20:42
Re: Unban cmd - by Minio1822 - 17.05.2010, 20:48
Re: Unban cmd - by NewTorran - 18.05.2010, 05:39
Re: Unban cmd - by Minio1822 - 18.05.2010, 13:47
Re: Unban cmd - by woot - 18.05.2010, 14:18
Re: Unban cmd - by Minio1822 - 18.05.2010, 17:23
Re: Unban cmd - by Minio1822 - 18.05.2010, 17:56
Re: Unban cmd - by Anwix - 18.05.2010, 18:05
Re: Unban cmd - by Minio1822 - 18.05.2010, 19:01
Re: Unban cmd - by Minio1822 - 19.05.2010, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)