array must be indexed - 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 (
/showthread.php?tid=637307)
array must be indexed -
AlexuTzVs - 12.07.2017
Код:
format(pcheck, sizeof(pcheck), "users/%s.ini", tmp);
if(dini_Exists(pcheck))
{
if(PlayerInfo[playerid][pLeader] == 15 && dini_Get(pcheck, "Member") == 15)
{
SendClientMessage(playerid, COLOR_WHITE, "Succes.");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Jucatorul nu este in factiunea ta.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Jucatorul nu exista.");
}
Код:
error 033: array must be indexed(variable "dini_Get")
This is the line with this issue
Код:
if(PlayerInfo[playerid][pLeader] == 15 && dini_Get(pcheck, "Member") == 15)
Can some1 help me ty
Re: array must be indexed -
kubak01 - 12.07.2017
You are trying to compare an integer and a string using ==
replace dini_Get with dini_Int, it's almost the same but it does strval() - converts an integer to a string.
https://sampwiki.blast.hk/wiki/Strval
By the way i think you should save the "Member" value into an variable like you just did with the Leader one, i remember dini being quite slow and you can make it way faster.
Re: array must be indexed -
AlexuTzVs - 12.07.2017
Nah just switching dini_Get with dini_Int was enough to make it work. thanks for trying to help me anyway. problem solved
Btw "Member" was saved as a variable but i was trying to uninvite a player from faction if he was not on the server that's why i was using dini in the first place. Anyway rep for the answer