26.03.2009, 03:26
when i make a teleport, how do imake it so it randomly teleports the player to different coordiantes instead of just 1 teleport..
new Float:RandomTeles[4][3] = // 4 for how much total, 3 for co-ords (1 for x 1 for y 1 for z) 1+1+1 = 3
{
{x,y,z},
{x,y,z},
{x,y,z},
{x,y,z}
};
new rand;
rand = random(sizeof(RandomTeles));
SetPlayerPos(playerid, RandomTeles[rand][0], RandomTeles[rand][1], RandomTeles[rand][2]);
C:\Users\rac\Desktop\gtasa and samp\gamemodes\choice.pwn(70) : error 018: initialization data exceeds declared size
new Float:RandomTeles[4][3] = // 4 for how much total, 3 for co-ords (1 for x 1 for y 1 for z) 1+1+1 = 3 { {3221.2466,-2430.5266,2.5561}, {3171.0720,-2432.4939,2.5561}, {3172.3948,-2423.6113,2.5561}, {3221.2227,-2418.0542,2.5631}, };
new rand; rand = random(sizeof(RandomTeles)); SetPlayerPos(playerid, RandomTeles[rand][0], RandomTeles[rand][1], RandomTeles[rand][2]);
new Float:RandomTeles[4][3] = // 4 for how much total, 3 for co-ords (1 for x 1 for y 1 for z) 1+1+1 = 3 { {3221.2466,-2430.5266,2.5561}, {3171.0720,-2432.4939,2.5561}, {3172.3948,-2423.6113,2.5561}, {3221.2227,-2418.0542,2.5631} };
Originally Posted by Oxside
Always rember when you use coordinats with {}
put NO , on the laste line! |