Checking two things with strcmp and doing the same thing?
#1

EDIT:

How can I check the whole string, and not just the first word?

pawn Код:
if(!strcmp(message, "bear", false) || !strcmp(message, "dog", false))
    {
        //user said an animal name!
        return 1;
    }
Reply
#2

pawn Код:
if(!strcmp(message, "bear", false)) || (!strcmp(message, "dog", false))
//Changes to
if(!strcmp(message, "bear", false)) || (!strcmp(message, "dog", false)))
Reply
#3

Fixed, i had a extra )...

pawn Код:
if(!strcmp(message, "bear", false)||!strcmp(message, "dog", false))
    {
        //user said an animal name!
        return 1;
    }
Reply
#4

Updated first post...
Reply
#5

if(-1 != strfind(message, "bear", false) || -1 != strfind(message, "dog", false))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)