array must be indexed
#1

Код:
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
Reply
#2

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.
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)