SA-MP Forums Archive
array must be indexed.. :I - 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: array must be indexed.. :I (/showthread.php?tid=136125)



array must be indexed.. :I - oggylt - 23.03.2010

yes it is under callback ondialog response where inputtext indexing makes it impossible to use and all other dialogs is working fine but this one asks for indexing


Код:
if(dialogid==11)
	{
	  if(response)
	  {
	    if(JackpotLife[playerid]==0)
	    {
	    	SendClientMessage(playerid,GRAY,"You lost, play again?");
	    	jackpotdiff[playerid]=0;
	    	return 1;
			}
	    	if(inputtext==Jackpot[playerid])
    	{
	      	GameTextForPlayer(playerid, "YOU WON!!!", 2000, 6);
	    	  if(jackpotdiff[playerid]==15)return GivePlayerMoney(playerid,2000);
				else if(jackpotdiff[playerid]==30) return GivePlayerMoney(playerid,5000);
				else if(jackpotdiff[playerid]==50) return GivePlayerMoney(playerid,10000);
	    	}
			else if(Jackpot[playerid]< inputtext)
			{
			  ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT,"Type your number:","Too BIG ","Type", "GiveUp");
				JackpotLife[playerid]=JackpotLife[playerid]-1;
				SendClientMessage(playerid,GRAY,"Too BIG!");
			}
			else if(Jackpot[playerid]> inputtext)
			{
				ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT,"Type your number:","Too SMALL ","Type", "GiveUp");
				JackpotLife[playerid]=JackpotLife[playerid]-1;
				SendClientMessage(playerid,GRAY,"Too SMALL!");
			}
		}
	}



Re: array must be indexed.. :I - ¤Adas¤ - 23.03.2010

Use strval(inputtext)


Re: array must be indexed.. :I - oggylt - 23.03.2010

thanks it worked