SA-MP Forums Archive
[SOLVED] /aunban ? How? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] /aunban ? How? (/showthread.php?tid=116485)



[SOLVED] /aunban ? How? - Mechscape - 29.12.2009

Код:
	if(strcmp(cmd, "/aunban", true) == 0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 5)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KASUTAMINE: /aunban [IP]");
				return 1;
			}
			IP = ReturnUser(tmp);
			SendRconCommand("unban %d",IP);
			SendRconCommand("unbanip %d",IP);
			SendClientMessage(playerid, COLOR_YELLOW, "IP have been unbanned!");
		}
		else
		{
			SendClientMessage(playerid, COLOR_GRAD1, "You must be a level 5 admin to do this command.");
		}
		return 1;
	}
Says me 3x "undefined bla bla "IP"" in Pawno Compiler.


Re: [UNSOLVED] /aunban ? How? - CuervO - 29.12.2009

pawn Код:
if(strcmp(cmd,"/unbanip",true) == x0)
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_GRAD1,"KASUTAMINE: /aunban [IP]");
            return 1;
        }
        format(string,sizeof(string),"unbanip %s",tmp);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
        format(string, sizeof(string), "* Successfuly Unbanned [%s] IP", tmp);
        SendClientMessage(playerid,TEAM_GROVE_COLOR,string);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You must be a level 5 admin to do this command.");
    }
    return 1;
}
That is how you should do it... Hopefully it works for you, i tested it and should work.



Re: [UNSOLVED] /aunban ? How? - Mechscape - 29.12.2009

Thanks