25.02.2011, 15:16
Well i got this Random Position ? Set up Is working fine but just 1 probblem
That Random Position is for a MiniGame and sometimes when the minigames starts 2/3 players are SPAWNED in same position.
How Can I Prevent This From Happening ?
If you want to see my code
That Random Position is for a MiniGame and sometimes when the minigames starts 2/3 players are SPAWNED in same position.
How Can I Prevent This From Happening ?
If you want to see my code
pawn Код:
//At the top of GM
new Float:RandomSpawn2[10][3] = {
{4443.4414,488.4186,30.9110},
{4467.0610,462.7075,30.8860},
{4467.3384,442.8307,30.8853},
{4509.6016,481.1109,48.0369},
{4484.2461,537.5523,48.0118},
{4443.5078,523.7330,30.6018},
{4362.3457,520.3850,30.5018},
{4361.7505,469.4979,30.5019},
{4320.5396,513.0151,48.0369},
{4455.7397,497.1385,48.0369}
};
//THen later On in Minigmae
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (playerinminigame[i] == 1)
{
new rand = random(sizeof(RandomSpawn2));
SetPlayerPos(i, RandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
}
//There is more but it has nothing to do with the problem.