SA-MP Forums Archive
I can't compline my GM cause of 1 error - 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: I can't compline my GM cause of 1 error (/showthread.php?tid=491666)



I can't compline my GM cause of 1 error - MrTinder - 31.01.2014

So..This is the code:

Код:
if(strval(GetServerIP()) != "84.238.198.10") return printf("Stupid stealer");
this is the error:

Код:
error 033: array must be indexed (variable "-unknown-")



Re: I can't compline my GM cause of 1 error - Misiur - 31.01.2014

pawn Код:
if(strval(GetServerIP()) != "84.238.198.10")
//that's wrong way to compare strings, use strcmp:
if(!strcmp(GetServerIP(), "84.238.198.10", false))



Re: I can't compline my GM cause of 1 error - Hoborific - 31.01.2014

I might be wrong, but I don't think you can use the not equal to operand to check strings. try using strcmp

pawn Код:
if(strcmp(strval(GetServerIP()),"84.238.198.10",false) == 0)
also you will need to bind the server ip in server.cfg to get the IP with GetServerIP ( once again, I think. not factual )


Re: I can't compline my GM cause of 1 error - MrTinder - 31.01.2014

The code don't work now..


Re: I can't compline my GM cause of 1 error - Manyula - 31.01.2014

There's also the possibility of binding your server to a certain IP by adding "bind" in your server.cfg.

https://sampwiki.blast.hk/wiki/Server.cfg

EDIT: Use the search function next time.
http://forum.sa-mp.com/showthread.ph...ht=getserverip


Re: I can't compline my GM cause of 1 error - MrTinder - 01.02.2014

I maked my own code.Look at the errors and help me to fix them.

P.S: Don't give me links for other scripts.