error 001: expected token: "-string end-", but found "-identifier-"
#2

You cannot compare an array with a string directly, you have to use a function (strcmp)

USAGE:
pawn Code:
if( strcmp(EchoChan,"channel",true,7) == 0 )
the 'true' is stating that it's going to ignore caps, so it can be 'Channel', 'CHANNEL', or 'channel', doesn't matter. The '7' is how far into either string (EchoChan or "channel") it's going to compare (if it were '4' it would only compare up until "chan"). We're seeing if it equals '0' because 'strcmp' will return 0 when the strings match.
Reply


Messages In This Thread
error 001: expected token: "-string end-", but found "-identifier-" - by cdcyborg - 14.11.2009, 04:17
Re: error 001: expected token: "-string end-", but found "-identifier-" - by Joe Staff - 14.11.2009, 06:22

Forum Jump:


Users browsing this thread: 2 Guest(s)