SA-MP Forums Archive
strcmp = bugged? - 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: strcmp = bugged? (/showthread.php?tid=338220)



strcmp = bugged? - Typhome - 29.04.2012

// Problem fixed by MadeMan.


Re: strcmp = bugged? - Aira - 29.04.2012

Fuck it, the thing is you forgot

if(kanepikontroll == 0)


Re: strcmp = bugged? - MadeMan - 29.04.2012

This is how strcmp works, it returns 0 if one of the strings is empty. So you should just check if they are not empty

pawn Код:
if(abKanep[x][kanep_rajaja][0] && strcmp(abKanep[x][kanep_rajaja], sendername) == 0)



Re: strcmp = bugged? - Aira - 29.04.2012

PHP код:
new kanepikontroll 0;
        for(new 
xsizeof(abKanep); x++) {
            if(
strcmp(abKanep[x][kanep_rajaja], sendername) == 0)
                {
                   if(
kanepikontroll == 1
                       {
                
kanepikontroll 1;
                
format(stringsizeof(string), "strcmp 1:[%s] 2:[%s] - matched strings"abKanep[x][kanep_rajaja], sendername);
                
SendClientMessageToAll(-1string);
                break;
            }
                   else
                        {
                               
SendClientMessage(playerid, -1"Sa oled juba vдhemalt ьhe kanepitaime kasvatama pannud.");              kanepikontroll 0;
                            
                         }
                   return 
1;
        } 
( Hard with the Language -.- )

EDIT: Nvm, i thought the Command was wrong or so, + i don't know shit about this 'stcmp' yet


Re: strcmp = bugged? - Typhome - 29.04.2012

// it works.. thanks to MadeMan.


Re: strcmp = bugged? - MadeMan - 29.04.2012

Show the enum where you create 'kanep_rajaja'.