[Help] Comparing strings (strcmp)
#1

I did it like that:
pawn Код:
if(!strcmp(inputtext, gServerPassword))
                {
                    SCM(playerid, COLOR_LIGHTRED, "Wrong password!");
                    Kick(playerid);
                    return 1;
                }
But I'm getting this error:
pawn Код:
error 035: argument type mismatch (argument 2)
Any ideas?
Reply
#2

maybe something to do with "gServerPassword" is it an array, does it hold a string? Also it looks like your comparing two passwords and if they are the same kicking them lol.
I think you want,
pawn Код:
if(strcmp(inputtext, gServerPassword))
Reply
#3

Try this, it should work, by the way you have to assign a string to that variable:
pawn Код:
if(strcmp(inputtext,gServerPassword,false))
                {
                    SCM(playerid, COLOR_LIGHTRED, "Wrong password!");
                    Kick(playerid);
                    return 1;
                }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)