menu problem
#1

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
Reply
#2

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

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;
Reply
#4

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;
Reply
#5

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


Forum Jump:


Users browsing this thread: 2 Guest(s)