Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
timer starting

 
Post new topic   Reply to topic Printable version
 View previous topic  Merv won't enter my zone Post :: Post No flags in the safe zone please :P  View next topic  
Author Message
pixelsoft
Seasoned Helper


Age:38
Gender:Gender:Male
Joined: Apr 15 2003
Posts: 154
Location: Vienna
Offline

PostPosted: Sat May 24, 2003 10:26 am    Post subject: timer starting Reply to topic Reply with quote

hey, can u tell me the code, how to start a timer (i already have a countdown[0]...), when there are 2 players playing(not speccing!!)?
_________________
i don't have anything important to say
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Sat May 24, 2003 11:51 am    Post subject: Reply to topic Reply with quote

Code: Show/Hide
int i=0;

_listnode <Player> *parse = playerlist->head;
while (parse)
{
   Player *p = parse->item;
   if (p->ship != SHIP_Spectator)
      ++i;

   parse = parse->next;
}

if (i == 2)
   countdown[1] = 5;


Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Back to top
View users profile Send private message Add User to Ignore List
pixelsoft
Seasoned Helper


Age:38
Gender:Gender:Male
Joined: Apr 15 2003
Posts: 154
Location: Vienna
Offline

PostPosted: Sat May 24, 2003 12:28 pm    Post subject: Reply to topic Reply with quote

thank you... but is this spawn.cpp or spawn.h
?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Sat May 24, 2003 5:52 pm    Post subject: Reply to topic Reply with quote

Theres no such code in spawn.h tongue.gif

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Back to top
View users profile Send private message Add User to Ignore List
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Sun May 25, 2003 8:55 pm    Post subject: Reply to topic Reply with quote

Or if you want, just do this, its how i would do it.

spawn.h;
Code: Show/Hide
class botInfo
{
   int SpecPop;
void CountSpec();
}


spawn.cpp;
Code: Show/Hide
void botInfo::CountSpec()
{
   SpecPop=0;
   _listnode <Player> * parse = playerlist->head;
   Player *p = parse->item;
   while (parse)
   {
      if (p->ship == SHIP_Spectate)
      //Or, if you want to count the FREQ not SHIP
      //if(p->team == /*spec freq*/)
      //put em together to ignore staff like me who play on the spec freq to talk.
         SpecPop++;
      parse = parse->next;
   }
}



Call it on EVENT_PlayerShip, EVENT_PlayerSpec, EVENT_PlayerEnter, and EVENT_PlayerExit. That would re-poll the entire arena every time, as a sort of double check. And in the EVENT_ArenaEnter and EVENT_ArenaLeave, for when the bot moves/spawns.

Added code tags -MGB
_________________
There are no stupid question, but there are many inquisitive idiots.
Loot

Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 54 page(s) served in previous 5 minutes.

phpBB Created this page in 0.500346 seconds : 29 queries executed (94.7%): GZIP compression disabled