HELP : [error 032: array index out of bounds (variable "MiniSpawn")]
#1

Help me fix this, I dunno about this.. When I compile I get "error 032: array index out of bounds (variable "MiniSpawn")"
I am sorry if I am fool to ask silly things, I am new in this field..

Код:
new Float:MiniSpawn[7][] =
{
        (-1435.8225,1480.2847,1.8672),
	(-1394.4995,1499.0162,3.8289),
	(-1383.8633,1495.4115,1.8516),
	(-1383.5131,1495.1149,8.9063),
	(-1395.1268,1483.7245,11.8084),
	(-1436.5436,1493.5347,7.1016),
	(-1479.2960,1489.8241,8.2578)
};
Код:
if (strcmp("/minigun1",cmdtext, true, 10)==0)
{
	ResetPlayerWeapons(playerid);
	SetPlayerVirtualWorld(playerid, 1);
	GivePlayerWeapon(playerid, 38, 15000);
  	OnPlayerSpawn(playerid);
	new randy = random(sizeof(MiniSpawn));
	SetPlayerPos(playerid, MiniSpawn[randy][0], MiniSpawn[randy][1], MiniSpawn[randy][2], MiniSpawn[randy][3], MiniSpawn[randy][4], MiniSpawn[randy][5], MiniSpawn[randy][6],MiniSpawn[randy][7]);
	SendClientMessage(playerid, COLOR_YELLOW, "Minigun Event, Kill them all");
	SendClientMessageToAll(COLOR_BRIGHTRED, "A player has joined the /minigun1 Area.");
	return 1;
}
Another Doubt

Код:
SendClientMessageToAll(COLOR_BRIGHTRED, "A player has joined the /minigun1 Area.");
In this line, how to make the player name to be shown.. Like if ma name is Mic_H.
Mic_H has joined the /minigun1 area??

Thank you..
Reply
#2

pawn Код:
enum MiniGunEnum
{
Float:Xx,
Float:Yy,
Float:Zz
}

new Float:MiniSpawn[7][MiniGunEnum] =
{
        (-1435.8225,1480.2847,1.8672),
    (-1394.4995,1499.0162,3.8289),
    (-1383.8633,1495.4115,1.8516),
    (-1383.5131,1495.1149,8.9063),
    (-1395.1268,1483.7245,11.8084),
    (-1436.5436,1493.5347,7.1016),
    (-1479.2960,1489.8241,8.2578)
};

SetPlayerPos(playerid, MiniSpawn[randy][Xx], MiniSpawn[randy][Yy], MiniSpawn[randy][Zz]); // usage like this <<
Reply
#3

Worked.. Thank you..
May god Bless ya.. Was behind this Error for 5hours..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)