SA-MP Forums Archive
menu problem - 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: menu problem (/showthread.php?tid=82056)



menu problem - Domenic_Montery - 15.06.2009

i got this error:
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemod es\ModernLife.pwn(5 : error 009: invalid array size (negative, zero or out of bounds)

line 58:
new PlayerInfo[MAX_PLAYERS][pInfo];

i am trying to make a on click in menu to buy licenses.(like driving)
i done case 0,1....... for all
i tried to add // infront of line 58

dont works PLEASE HELP


Re: menu problem - dice7 - 15.06.2009

replace pInfo with a number. With
pawn Код:
new PlayerInfo[MAX_PLAYERS][3];
you're declaring a 2d array


Re: menu problem - Domenic_Montery - 16.06.2009

then i got this:
Код:
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(578) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(585) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(591) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(603) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(609) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(621) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(627) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(639) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\Semir\Desktop\samp02Xserver.win32\gamemodes\ModernLife.pwn(645) : error 032: array index out of bounds (variable "PlayerInfo")
error rowsnote i just took error parts from the script)

PlayerInfo[playerid][pGunLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pCarLic] = 1;


Re: menu problem - MiniYoda - 16.06.2009

You have to use "enum" ...

Код:
enum information {pGunLic,pBoatLic,pFlyLic,pCarLic};
new PlayerInfo[MAX_PLAYERS][information];
If you want to add a string to PlayerInfo or a Float, you only have to at a float: or a [1024]

For example:

Код:
enum information {float:x, playername[MAX_PLAYER_NAME], kills};
So, now you can use:
Код:
PlayerInfo[playerid][pGunLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pCarLic] = 1;



Re: menu problem - Domenic_Montery - 16.06.2009

i just Added [1024] and working great.
Thank you