Comparing " == " help - 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: Comparing " == " help (
/showthread.php?tid=526681)
Comparing " == " help -
mrkiller90 - 18.07.2014
(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?
Re: Comparing " == " help -
nmader - 18.07.2014
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
Re: Comparing " == " help -
Dignity - 18.07.2014
You should use strcmp to compare strings.
https://sampwiki.blast.hk/wiki/Strcmp
EDIT: See above
Re: Comparing " == " help -
mrkiller90 - 18.07.2014
Oh thanks (: