SA-MP Forums Archive
LuxAdmin - /unban - 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)
+--- Thread: LuxAdmin - /unban (/showthread.php?tid=333631)



LuxAdmin - /unban - tyler12 - 12.04.2012

I need a '/unban' command for luxadmin

Here is my /ban command
pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
    {
        new name[MAX_PLAYER_NAME];
        new giveplayer[MAX_PLAYER_NAME];
        new giveplayerid;
       
        if(AccInfo[playerid][Level] >= 4)
        {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Day(s)] [Reason]");
                SendClientMessage(playerid, orange, "Function: Bans the player for the ammount of days");
                SendClientMessage(playerid, orange, "Hacking - 30 days");
                SendClientMessage(playerid, orange, "Minor insult - 3 days");
                SendClientMessage(playerid, orange, "Major insult - 7 days");
                SendClientMessage(playerid, orange, "Other - Make sure it is not stupid");
                SendClientMessage(playerid, orange, "Always put a valid reason!!!!!");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                tmp = strtok(cmdtext, idx);
                if (!strlen(tmp))
                {
                SendClientMessage(playerid, LIGHTBLUE2, "Usage: /tempban [PlayerID] [Day(s)] [Reason]");
                SendClientMessage(playerid, orange, "Function: Temporarily bans a player for specified Days");
                return 1;
                }
                new days = strval(tmp);
                if(!IsNumeric(tmp))
                return SendClientMessage(playerid, lightred, "ERROR: Invalid Day! Only Numbers!");
               
                if(strval(tmp) <= 0 || strval(tmp) > 1000)
                return SendClientMessage(playerid, lightred, "ERROR: Invalid Day! (1-1000)");
               
                new reason[128];
                reason = strtok2(cmdtext,idx);
                if (!strlen(reason))
                return SendClientMessage(playerid, lightred, "ERROR: Reason not Specified!");
               
                if (strlen(reason) <= 0 || strlen(reason) > 100)
                return SendClientMessage(playerid, lightred, "ERROR: Invalid Reason length!");
               
                new ip[15];
                GetPlayerIp(giveplayerid,ip,15);
                GetPlayerName(playerid, name, sizeof name);
                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                new File:tempban = fopen("LuxAdmin/Config/TempBans.ban", io_append);
                if (tempban)
                {
                    new year,month,day;
                    getdate(year, month, day);
                    day += days;
                    if (IsMonth31(month))
                    {
                        if (day > 31)
                        {
                            month += 1;
                            if (month > 12)
                            {
                                year += 1;
                                while(day > 31) day -= 31;
                            }
                            else while(day > 31) day -= 31;
                        }
                    }
                    else if (!IsMonth31(month))
                    {
                        if (day > 30)
                        {
                            month += 1;
                            if (month > 12)
                            {
                                year += 1;
                                while(day > 30) day -= 30;
                            }
                            else while(day > 30) day -= 30;
                        }
                    }
                    else if (!IsMonth31(month) && IsMonth29(year) && month == 2)
                    {
                        if (day > 29)
                        {
                            month += 1;
                            if (month > 12)
                            {
                                year += 1;
                                while(day > 29) day -= 29;
                            }
                            else while(day > 29) day -= 29;
                        }
                    }
                    else if (!IsMonth31(month) && !IsMonth29(year) && month == 2)
                    {
                        if (day > 28)
                        {
                            month += 1;
                            if (month > 12)
                            {
                                year += 1;
                                while(day > 28) day -= 28;
                            }
                            else while(day > 28) day -= 28;
                        }
                    }
                    format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, ip);
                    fwrite(tempban, string);
                    fclose(tempban);
                }
                format(string,128,"|- Administrator %s Temporarily Banned %s for %d Day(s) | Reason: %s -|",name,giveplayer,days,reason);
                SendClientMessageToAll(lightred,string);
                Kick(giveplayerid);
               
                format(string, sizeof string, "Admin %s Temporarily Banned %s for %d Day(s) | Reason: %s",name,giveplayer,days,reason);
                SaveIn("TempBansLog",string);
            }
            else
            {
            ErrorMessages(playerid, 2);
            }
        }
        else return ErrorMessages(playerid, 1);
        return true;
    }



Re: LuxAdmin - /unban - niyaz - 12.04.2012

Is your server home hosted if it is go to samp.ban and take their name off or IP


Re: LuxAdmin - /unban - tyler12 - 12.04.2012

Quote:
Originally Posted by niyaz
Посмотреть сообщение
Is your server home hosted if it is go to samp.ban and take their name off or IP
nope..
Other admins need to be able to unban..


Re: LuxAdmin - /unban - ...: 1 :... - 12.04.2012

Quote:
Originally Posted by tyler12
Посмотреть сообщение
nope..
Other admins need to be able to unban..
Go into the file using Fexist.


Re: LuxAdmin - /unban - -Sam_hero- - 28.08.2012

go to server promote urself, then do /console > unban ip then the ip and then do /console > reload bans. that to reload ban list