SA-MP Forums Archive
Arrays 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Arrays must be indexed (/showthread.php?tid=65990)



Arrays must be indexed - smallo - 18.02.2009

I am using Useful Functions include to use the OnPlayerGamble function. but i am getting the following errors.

Код:
C:\Program Files\Rockstar Games\GTA San Andreas (SAMP)\SAMP\pawno\include\uf.inc(4286) : error 033: array must be indexed (variable "betting")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
heres the code im using.

pawn Код:
public OnPlayerGamble(playerid,type,bet,wl)
{
        new PlayerInterior = GetPlayerInterior(playerid);
        if (PlayerInterior == 12)
        {
            SetCameraBehindPlayer(playerid);
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid,1659.4200,2252.7900,11.0701);
            TogglePlayerControllable(playerid,1);
            }
            else if (PlayerInterior == 1)
            {
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid,2193.6484,1676.5054,12.3672);
                TogglePlayerControllable(playerid,1);
                }
                else if (PlayerInterior == 10)
                {
                    SetCameraBehindPlayer(playerid);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid,2022.6898,1007.0966,10.8203);
                    TogglePlayerControllable(playerid,1);
                }
            }



Re: Arrays must be indexed - smallo - 18.02.2009

anyone?


Re: Arrays must be indexed - ICECOLDKILLAK8 - 18.02.2009

Post the error line then we might be able to help you


Re: Arrays must be indexed - smallo - 18.02.2009

ummmm its in my first post, it always was. I believe its a problem with uf.inc


Re: Arrays must be indexed - ICECOLDKILLAK8 - 18.02.2009

Didnt notice that it was in an include, Port the include error line


Re: Arrays must be indexed - smallo - 19.02.2009

I have posted the entire include here http://pastebin.ca/1341664

And heres the area where the code is having that above error. The actual line is 4286.
Код:
4285.    #if defined OnPlayerGamble
4286.        if(betting != 0)
4287.        {
4288.           OnPlayerGamble(playerid,betting[playerid],bets[playerid],1);
4289.           betting[playerid] = 0;
4290.           bets[playerid] = 0;
4291.           } 
4292.    #endif
4293.    }



Re: Arrays must be indexed - Sandra18[NL] - 19.02.2009

Try:

Код:
if(betting[playerid] != 0)



Re: Arrays must be indexed - smallo - 19.02.2009

alright thanks ill try, cant try until im home from school :P so i will let you know in about 4 hours.


Re: Arrays must be indexed - smallo - 19.02.2009

Quote:
Originally Posted by =>Sandra<=
Try:

Код:
if(betting[playerid] != 0)
thanks man i got rid of my error!