Got some error while making random spawns
#1

^^ :3
pawn Код:
new Float:RandomHungerSpawns[8][4] =
{
    { 3731.6741, -1531.2792, 28.5888, 213.9815 },
    { 3791.8962, -1529.7880, 27.2358, 177.3446 },
    { 3845.0371, -1511.6122, 27.4145, 252.3116 },
    { 3956.5200, -1562.8573, 20.7654, 255.1316 },
    { 4070.8125, -1601.0966, 25.5049, 237.2714 },
    { 4171.0752, -1748.9218, 14.5830, 168.0512 },
    { 4156.0005, -1893.0757, 17.0822, 51.3629 }
};
pawn Код:
SetPlayerRandomHungerSpawns(playerid)
{
    new rand = random(sizeof(RandomHungerSpawns));
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, RandomHungerSpawns[rand][0], RandomHungerSpawns[rand][1], RandomHungerSpawns[rand][2]);
    SetPlayerFacingAngle(playerid, RandomHungerSpawns[rand][3]);
    SetPlayerVirtualWorld(playerid, 365);
    return 1;
}
When I compiled this, I got this error:
Код:
C:\Users\Matt\Desktop\MP-Related\Gamemode\Stunt Universe\0.3z\filterscripts\HungerGames.pwn(31) : error 052: multi-dimensional arrays must be fully initialized
Line 31:
pawn Код:
{ 4156.0005, -1893.0757, 17.0822, 51.3629 }
}; // >> >> HERE << <<
Reply
#2

pawn Код:
new Float:RandomHungerSpawns[7][4] =
You have only 7 spawns defined into the array.
Reply
#3

pawn Код:
new Float:RandomHungerSpawns[][4] =
{
    { 3731.6741, -1531.2792, 28.5888, 213.9815 },
    { 3791.8962, -1529.7880, 27.2358, 177.3446 },
    { 3845.0371, -1511.6122, 27.4145, 252.3116 },
    { 3956.5200, -1562.8573, 20.7654, 255.1316 },
    { 4070.8125, -1601.0966, 25.5049, 237.2714 },
    { 4171.0752, -1748.9218, 14.5830, 168.0512 },
    { 4156.0005, -1893.0757, 17.0822, 51.3629 }
};
Reply
#4

Quote:
Originally Posted by Scottas
Посмотреть сообщение
pawn Код:
new Float:RandomHungerSpawns[][4] =
{
    { 3731.6741, -1531.2792, 28.5888, 213.9815 },
    { 3791.8962, -1529.7880, 27.2358, 177.3446 },
    { 3845.0371, -1511.6122, 27.4145, 252.3116 },
    { 3956.5200, -1562.8573, 20.7654, 255.1316 },
    { 4070.8125, -1601.0966, 25.5049, 237.2714 },
    { 4171.0752, -1748.9218, 14.5830, 168.0512 },
    { 4156.0005, -1893.0757, 17.0822, 51.3629 }
};
Fixed! :O
Ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)