SA-MP Forums Archive
strfind problems - 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: strfind problems (/showthread.php?tid=417997)



strfind problems - Infinity90 - 23.02.2013

I've just started using strfind for some functions which I'am trying to do.
When I ban someone it saves there IP in a file but when they connect it's "mean't" to say "Your banned....." but for some reason it's not reading the file and finding the ip. Summery, it's not finding the line of the match IPs.
pawn Код:
new File:BannedIPs;
    if ((BannedIPs = fopen( "BannedIPs.txt", ( fexist("BannedIPs.txt") ? io_append : io_read ) ))) {
        new aname3[MAX_PLAYER_NAME];
            GetPlayerName(playerid,aname3,MAX_PLAYER_NAME);
        if(strfind(pInfo[playerid][pIP],playerip, false)) {
Thanks in advance.


Re: strfind problems - PinkFloydLover - 23.02.2013

try
pawn Код:
if(strfind(string, string) != 1)
to detect if they match


Re: strfind problems - Infinity90 - 23.02.2013

Never worked.