Guten Tag Bread Fish Community,
Ich bin grade dabei den Job "Holzfäller" zu erstellen.
Für den Job möchte ich 10 Random Checkpoints erstellen die zum jeweiligen Baum führen sollen.
new Float:BaumCP[10][3] ={
{-371.29886, -1756.20410, 31.87299},
{-628.65155, -1558.58704, 16.78062},
{-606.95587, -1587.30298, 17.05888},
{-586.49298, -1553.76563, 9.25238},
{-597.12677, -1614.80920, 20.08815},
{-546.96436, -1610.25415, 19.81961},
{-571.46704, -1582.55701, 7.79059},
{-539.91882, -1590.97705, 4.91551},
{-568.49506, -1556.31909, 6.57102},
{-533.78589, -1642.70801, 12.36856}
};
new BaumCPRand [MAX_PLAYERS];
forward SetPlayerRandomCheckpoints(playerid);
public SetPlayerRandomCheckpoints(playerid)
{
new BaumCPRand = random(sizeof(BaumCP));
SetPlayerCheckpoint(playerid, BaumCP[BaumCPRand][0], BaumCP[BaumCPRand][1], BaumCP[BaumCPRand][2], BaumCP[BaumCPRand][3], BaumCP[BaumCPRand][4], BaumCP[BaumCPRand][5], BaumCP[BaumCPRand][6]...);
}
return 1;
}
Allerdings wenn ich Compile Bekomme ich 2 Errors und 2 Warnings:
C:\Users\Lukas\Desktop\Script\Neuer Ordner (6)\gamemodes\WoS.pwn(56800) : warning 219: local variable "BaumCPRand" shadows a variable at a preceding level
C:\Users\Lukas\Desktop\Script\Neuer Ordner (6)\gamemodes\WoS.pwn(56801) : error 032: array index out of bounds (variable "BaumCP")
C:\Users\Lukas\Desktop\Script\Neuer Ordner (6)\gamemodes\WoS.pwn(56803) : error 010: invalid function or declaration
C:\Users\Lukas\Desktop\Script\Neuer Ordner (6)\gamemodes\WoS.pwn(57058) : warning 203: symbol is never used: "BaumCPRand"
Ich hoffe jemand kann mir helfen.
MFG
Lukas