SA-MP Forums Archive
Help me please in ip - 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: Help me please in ip (/showthread.php?tid=493835)



Help me please in ip - Size - 10.02.2014

PHP код:
if(strcmp(IPdatatrue) != "127.0.0.1"SendRconCommand("exit"); 
Error:
PHP код:
error 033: array must be indexed (variable "-unknown-"



Re: Help me please in ip - Kirollos - 10.02.2014

you can't compare a string to a function that returns an integer.

You can use something like this:

pawn Код:
if(strcmp(IP, "127.0.0.1", true) != 0) // if IP wasn't 127.0.0.1
    SendRconCommand("exit"); // Runs "exit"
where strcmp returns 0 if comparison succeeded.

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


Re: Help me please in ip - Size - 10.02.2014

Thanks