02.08.2009, 18:30
Hi, I've got a random spawn in my script which's moving down. If one of the spawn points has Z<0, it'll get inactive. If all of these spawn points had Z<0, a new random spawn should get enabled. But it doesn't work. Instead of this I spawn at a harbor.
Is it up to the code or's something different the reason? Thanks for help.
Here's the code:
Is it up to the code or's something different the reason? Thanks for help.
Here's the code:
pawn Код:
public OnPlayerSpawn(playerid)
{
new iRandom;
if(SpawnsAreDead==0)
{
new i;
do
{
iRandom=random(sizeof(RandomSpawn));
i++;
if(i>=124)
{
SpawnsAreDead=1;
break;
}
}
while(RandomSpawn[iRandom][2]-gZ<0);
if(SpawnsAreDead==0)
{
SetPlayerPos(playerid,RandomSpawn[iRandom][0],RandomSpawn[iRandom][1],RandomSpawn[iRandom][2]-gZ);
SetPlayerFacingAngle(playerid,RandomSpawn[iRandom][3]);
}
}
if(SpawnsAreDead==1)
{
iRandom=random(sizeof(RS2));
SetPlayerPos(playerid,RS2[iRandom][0],RS2[iRandom][1],RS2[iRandom][2]-gZ);
SetPlayerFacingAngle(playerid,RS2[iRandom][3]);
}
return 1;
}