SA-MP Forums Archive
Small problem - 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: Small problem (/showthread.php?tid=223286)



Small problem - Face9000 - 09.02.2011

Hi,i made a sort of auto blacklist.When an admin ban a player,the banned player name going in a .txt file and OnPlayerConnect i made this.

pawn Код:
if(strcmp(dini_Get("/blacklist.txt",name),true)
    {
        format(msg,sizeof msg,"7,2EVADER ALERT: Possible ban evade from %s - Autoban done.",name);
        IRC_GroupSay(IRC_Group, EchoChan, msg);
        if(strcmp(IP,dini_Get("/aips.log",name),true) == 0)
        {
            format(msg,sizeof msg,"7,2AC ALERT: (ID: 505) - Detected ban evasion by %s with IP: %s",name,IP);
            format(msg,sizeof msg,"7,2AC ALERT: (ID: 505) - The IP %s is associated at ban evader %s from country %s",IP,name,GetPlayerCountryName(playerid));
            format(msg,sizeof msg,"7,2AC ALERT: (ID: 505) - %s with IP: %s was Auto Kicked by AntiCheat for Attempted Ban Evasion.",name,IP);
            IRC_GroupSay(IRC_Group, EchoChan, msg);
            BanEx(playerid, "Banned by System for: BAN EVASION.");
            format(msg,sizeof msg,"banip %s",IP);
            SendRconCommand(msg);
        }
        return Ban(playerid);
    }
It work in this way:

When a player connect,the server will check if the name is in blacklist.txt

IF IS in that file,than the player will be automatically re-banned,but i got a problem:

error 035: argument type mismatch (argument 2)

Error line is:

pawn Код:
if(strcmp(dini_Get("/blacklist.txt",name),true)
Thanks.


Re: Small problem - Mean - 09.02.2011

You can't use strcmp in dini_Get. Use:
pawn Код:
if ( dini_Get ( "/blacklist.txt",name ) )



Re: Small problem - Face9000 - 09.02.2011

error 033: array must be indexed (variable "dini_Get")


Re: Small problem - Face9000 - 09.02.2011

BUMP.


Re: Small problem - Mean - 09.02.2011

pawn Код:
new file[256];
format(file, sizeof(file), "blacklist.txt");
if ( dini_Get (file, name ) )
?


Re: Small problem - Face9000 - 09.02.2011

Same error.


Re: Small problem - Mokerr - 09.02.2011

You forgot a ).

from: if(strcmp(dini_Get("/blacklist.txt",name),true)
to: if(strcmp(dini_Get("/blacklist.txt",name),true))


Re: Small problem - MadeMan - 09.02.2011

How do you save a name to the blacklist?


Re: Small problem - Face9000 - 09.02.2011

@Mokerr,now i get this:

error 035: argument type mismatch (argument 2)

@MadeMan,i use custom log system to save the name of player when gets banned.


Re: Small problem - MadeMan - 09.02.2011

pawn Код:
if(strcmp(dini_Get("/blacklist.txt",name),name,true) == 0)
But not sure if it works, because I don't know how you save it.