SA-MP Forums Archive
Run time error 4: "Array index out of bounds" - 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)
+--- Thread: Run time error 4: "Array index out of bounds" (/showthread.php?tid=659725)



Run time error 4: "Array index out of bounds" - skiplovebra - 14.10.2018

Код:
[18:13:53] [debug] Run time error 4: "Array index out of bounds"
[18:13:53] [debug] AMX backtrace:
[18:13:53] [debug] #0 00400200 in public OnPlayerSpawn (1) from GTA-RP.amx
Код:
new Text3D:NameFam[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
	SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
	SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
	
	new nfa[128], Float:plf[3];
	GetPlayerPos(playerid, plf[0], plf[1], plf[2]);
	format(nfa, sizeof(nfa), "%s", FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyName]);
	Delete3DTextLabel(NameFam[playerid]);
	NameFam[playerid] = Create3DTextLabel(nfa, COLOR_WHITE, plf[0], plf[1], plf[2], 20.0, 
       GetPlayerVirtualWorld(playerid));
	Attach3DTextLabelToPlayer(NameFam[playerid], playerid, 0.0, 0.0, -0.2);
        return 1;
        }



Re: Run time error 4: "Array index out of bounds" - KinderClans - 14.10.2018

pawn Код:
FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyName]);
What's the logic of doing this just to show a name?


Re: Run time error 4: "Array index out of bounds" - skiplovebra - 14.10.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
pawn Код:
FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyName]);
What's the logic of doing this just to show a name?
Family


Re: Run time error 4: "Array index out of bounds" - skiplovebra - 14.10.2018

bump