SA-MP Forums Archive
Bugged Commands - 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: Bugged Commands (/showthread.php?tid=273103)



Bugged Commands - seanny - 31.07.2011

Hello, Here are a few commands in my server which are Bugged

pawn Код:
if(strcmp(cmd,"/unbanip",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pBanAppealer])
            {
                tmp = strtok(cmdtext,idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid,COLOR_WHITE,"USAGE: /unbanip [IP Address]");
                    return 1;
                }
                format(string,sizeof(string),"unbanip %s",tmp);
                SendRconCommand(string);
                SendRconCommand("reloadbans");
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "AdmCmd: %s has UnBanned IP Address: %s", sendername, tmp);
                ABroadCast(COLOR_LIGHTRED,string,1);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not authorized to use that command !");
            }
        }
        return 1;
    }
pawn Код:
dcmd_unban(playerid, params[])
{
    new name[120], file[126],string[100], string2[100], playerIP[256];
    if(PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pBanAppealer] == 1)
    {
        if (sscanf(params, "s", name)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unban [Account Name]");
        format(file,sizeof(file),"%s.ini",name);
        if(!fexist(file))
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid Player Account");
            return 1;
        }
        else
        {
            format(file, sizeof(file), "%s.ini", name);
            new File: hFile = fopen(file, io_append);
            if(hFile)
            {
                new var[32];
                playerIP = dini_Get(file, "IP");
                format(var, 32, "Band=0");
                format(var, 32, "PermBand=0");
                format(var, 32, "Disabled=0");
                format(var, 32, "Warnings=0");
                fwrite(hFile, var);
                fclose(hFile);
            }
            format(string, sizeof(string), "unbanip %s", playerIP);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
            SendClientMessage(playerid, COLOR_YELLOW, "Member Unbanned Successfully !");
            format(string2, 256, "AdmCmd: %s has Unbanned Account Name '%s' and IP '%s'",PlayerName(playerid),name,playerIP);
            ABroadCast(COLOR_LIGHTRED, string2, 1);
        }
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "You are not Authorized to use this.");
        return 1;
    }
}



Re: Bugged Commands - Calgon - 31.07.2011

You need to be more specific, saying "THESE COMMANDS ARE BUGGED" isn't going to help us fix your problem. Tell us how they're bugged and what happens when you use them. A 'please' and 'thank you' really should be used in your post too, we're helping you with our spare time - we really don't have to!


Re: Bugged Commands - seanny - 31.07.2011

Well...... /unban Doesent unban anyone and /unbanip doesent unban anyones IP