int InitProc()
{
int cnt,i,j,type,weapon,x,y;
Unit u;
for (cnt=0; cnt<TethysGame::NoPlayers(); ++cnt)
{
_player[cnt].CenterViewOn(159,127);
}
for (i=0; i<60; ++i)
{
for (j=0; j<TethysGame::NoPlayers(); ++j)
{
do { type=TethysGame::GetRand(7)+1; } while (type<4);
do { weapon=TethysGame::GetRand(74)+1; } while (weapon<59);
x=TethysGame::GetRand(256)+31;
y=TethysGame::GetRand(256)-1;
TethysGame::CreateUnit(u,type,LOCATION(x,y),j,weapon,6);
u.DoSetLights(1);
u.DoMove(127,159);
}
}
CreateTimeTrigger(1,0,1,"ExTrig");
return 1;
}
void ExTrig()
{
}
How close did i get ?
:D
[EDIT]
You can improve your code by changing this:
type=TethysGame::GetRand(4)+4;
weapon=TethysGame::GetRand(15)+59;
also, put NoPlayers() into a variable, so you won't have to call the function everytime. Just call it once, and store it.