SA-MP Forums Archive
"Array Must Be Indexed" 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: "Array Must Be Indexed" error (/showthread.php?tid=347544)



"Array Must Be Indexed" error - nuriel8833 - 02.06.2012

Whenever I compile my gamemode I get the "Array Must Be Indexed (Array - "dini_Get)" for each of these lines:
pawn Код:
dini_Set(PlayerFile(kr),"Kills",dini_Get(PlayerFile(kr),"Kills")+1);
    dini_Set(PlayerFile(kr),"Ratio",dini_Get(PlayerFile(kr),"Kills") / dini_Get(PlayerFile(kr),"Deaths"));
    dini_Set(PlayerFile(kd),"Deaths",dini_Get(PlayerFile(kd),"Deaths")+1);
    dini_Set(PlayerFile(kd),"Ratio",dini_Get(PlayerFile(kd),"Kills") / dini_Get(PlayerFile(kd),"Deaths"));
How can I solve this issue?
Thanks and Rep+ for helpers


Re: "Array Must Be Indexed" error - Niko_boy - 02.06.2012

dini_Get
is used for strings not var
use Dini_GetInt
and Dini_SetInt
So, u cant user PlayerFile(kr) etc.. in dini_get or set


Re: "Array Must Be Indexed" error - MadeMan - 02.06.2012

Use dini_Int instead of dini_Get and dini_SetInt instead of dini_Set.