array prob
#1

Код:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == TheBiz)
{
if(BizInfo[TheBiz][TEAM_GAMBINO][OwnerTeam] == 1)
{
    new str[128];
    format(str, sizeof(str), "Owner Team:[%d]|| ",BizInfo[TheBiz][OwnerTeam] ); // ERROR
		SendClientMessage(playerid, COLOR_YELLOW, str);
}
}
if(pickupid == TheBiz2)
{
    new str[128];
    format(str, sizeof(str), "Owner Team:[%d] Name:[%s]|| ",BizInfo[TheBiz2][OwnerTeam], BizInfo[TheBiz2][Name]); // ERROR
		SendClientMessage(playerid, COLOR_YELLOW, str);
}
Код:
#define TEAM_GAMBINO 1
#define TEAM_BONANNO 2
#define TEAM_COLOMBO 3

new TheBiz;
new TheBiz2;
enum bInfo
{
	 Name[60],
	 OwnerTeam,
}
new BizInfo[MAX_PICKUPS][MAX_TEAMS][bInfo];
ONGAMEMODEINIT
Код:
 format(BizInfo[TheBiz][Name], 60, "Cool eH!!?");
 BizInfo[TheBiz][TEAM_GAMBINO][OwnerTeam] = 1;
 format(BizInfo[TheBiz2][Name], 60, "Gambino PROP!!?");
 {
 TheBiz = CreatePickup(1314, 2, 96.4268,1920.3264,18.1383);
 print("Pickup 1 Loaded!");
 }
 {
 TheBiz2 = CreatePickup(1314, 2, 89.2782,1920.9259,17.9121);
 print("Pickup 2 Loaded!");
 }
NOTE: i have comentted those lines where errors are!!

Код:
C:\Documents and Settings\S\Desktop\Untitled.pwn(171) : error 032: array index out of bounds (variable "BizInfo")
C:\Documents and Settings\S\Desktop\Untitled.pwn(178) : error 032: array index out of bounds (variable "BizInfo")
And if i put it in my gamemode it doesnt show any errors
i want to put it into a FS

Can someone help me?
Reply
#2

pawn Код:
new BizInfo[MAX_PICKUPS][MAX_TEAMS][bInfo];
Try this one:

pawn Код:
new BizInfo[MAX_PICKUPS][bInfo];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)