Must be a constant expression - 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: Must be a constant expression (
/showthread.php?tid=589873)
Must be a constant expression -
karemmahmed22 - 23.09.2015
PHP код:
new ip[16];
format(ip,sizeof(ip),"%s",GetIP(playerid));
new result = strcmp(ip,tmpIP);
#if result == 0
:/
error line:
i tried to change it to:
same error, any ideas?
I want to make auto login, i retriving ip to tmpIP variable, and getting player ip with the code above,
I want to check if ips match, it just log the player on, if itsn't match, just display login dialogs.
Re: Must be a constant expression -
Andre02 - 23.09.2015
change
to
Re: Must be a constant expression -
karemmahmed22 - 23.09.2015
already fixed, thank you, i figured out that i can use if instead of #if to check
![Tongue](images/smilies/razz.gif)
i already knew about 'if' but i was trying to do it with #if
However, thanks for reply, repped.