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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error (
/showthread.php?tid=275477)
error -
omer5198 - 09.08.2011
Код:
D:\Games\GTASAN~2\GODFUC~1\GAMEMO~1\Mode.pwn(3140) : error 033: array must be indexed (variable "dini_Get")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
line:
Код:
if(dini_Get(file, "IP") == GetPlayerIp(playerid, IP, 16))
Re: error -
MadeMan - 09.08.2011
pawn Код:
GetPlayerIp(playerid, IP, 16);
if(strcmp(dini_Get(file, "IP"), IP) == 0)
Re: error -
[HiC]TheKiller - 09.08.2011
Use
strcmp.
pawn Код:
GetPlayerIp(playerid, IP, 16);
if(!strcmp(dini_Get(file, "IP"), IP))
Re: error -
omer5198 - 09.08.2011
thx... it works but how does strcmp works? can someone explain the code to me?
Re: error -
MadeMan - 09.08.2011
Doing
pawn Код:
if(strcmp(dini_Get(file, "IP"), IP) == 0)
actually means
pawn Код:
if(dini_Get(file, "IP") == IP)
but you can't compare strings like that in pawn, you must use strcmp for that.
strcmp is pretty much same as == but used for strings.
Re: error -
omer5198 - 10.08.2011
ok, thx!