array index out of bounds
#1

hey guys whats wrong with this..
Quote:

public OnPlayerConnect(playerid)
{
new file[64];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "/Gold/%s.ini", pname);
if(dini_Exists(file))
{
}
else
{
dini_Create(file);
dini_IntSet(file, "GoldBars",0);
}
return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
new gold = PlayerInfo[MAX_PLAYERS][Gold];
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/Gold/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file, "GoldBars", gold);
}
return 1;
}
CMD:gold(playerid,params[])
{
new gold = PlayerInfo[MAX_PLAYERS][Gold];
gold += 1;
return 1;
}

it gives me this
Quote:

C:\Users\ALK3KA3\Documents\Hossam\Games and Other\AQW Movies\San Andreas Multiplayer Scripting\SAMP server (GM Files)\filterscripts\GoldBars.pwn(59) : error 032: array index out of bounds (variable "PlayerInfo")
C:\Users\ALK3KA3\Documents\Hossam\Games and Other\AQW Movies\San Andreas Multiplayer Scripting\SAMP server (GM Files)\filterscripts\GoldBars.pwn(240) : error 032: array index out of bounds (variable "PlayerInfo")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

change MAX_PLAYERS to playerid
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)