Comparing " == " help
#1

(I am sorry if this is a stupid and obvious question but the answer don't come to my head right now)

How can I compare something to a name like:

if(HouseInfo[i][hOwner] == "None")

But like this it gives me an error variable"-unknown"
I don't want to format it there is some way?
Reply
#2

So, you are attempting to compare strings.
pawn Код:
strcmp(HouseInInfo[i][hOwner], "none", true, 56); //The 56 is the length, edit it as necessary.
For more details: https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

You should use strcmp to compare strings.

https://sampwiki.blast.hk/wiki/Strcmp

EDIT: See above
Reply
#4

Oh thanks (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)