I have this random spawn code:
OnPlayerSpawn:
Can someone tell me why doesn't work? I dont get any error while compiling.
When i spawn, i spawn in a factory near LV bridge, i tried spawning multiple times and i always spawn there.
What's wrong?
Code:
new Float:RandomUSACoords[10][3] =
{
(-219.5760,2704.1409,62.5391), // Random Usa Spawn 1
(-198.5659,2713.6584,62.5391), // Random Usa Spawn 2
(-247.3498,2678.3420,62.5391), // Random Usa Spawn 3
(-230.0754,2596.5901,62.5391), // Random Usa Spawn 4
(-236.6343,2597.4094,78.7681), // Random Usa Spawn 5
(-250.2850,2602.0071,67.3468), // Random Usa Spawn 6
(-296.3360,2713.4448,65.5440), // Random Usa Spawn 7
(-302.6953,2691.2366,62.6875), // Random Usa Spawn 8
(-166.2483,2720.6833,61.9878), // Random Usa Spawn 9
(-161.6798,2651.2500,80.1681) // Random Usa Spawn 10
};
OnPlayerSpawn:
Code:
if(gTeam[playerid] == TEAM_USA)
{
SetRandomUSAPos(playerid);
}
Code:
stock SetRandomUSAPos(playerid)
{
if( gTeam[playerid] == TEAM_USA )
{
new rand = random(sizeof(RandomUSACoords));
SetPlayerPos(playerid, RandomUSACoords[rand][0],RandomUSACoords[rand][1],RandomUSACoords[rand][2]);
}
return 1;
}
Can someone tell me why doesn't work? I dont get any error while compiling.
When i spawn, i spawn in a factory near LV bridge, i tried spawning multiple times and i always spawn there.
What's wrong?