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
warping 4 players to 4 diff. places

 
Post new topic   Reply to topic Printable version
 View previous topic  Game ends... Post :: Post Help with invbot  View next topic  
Author Message
pixelsoft
Seasoned Helper


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

PostPosted: Tue Jul 29, 2003 1:33 pm    Post subject: warping 4 players to 4 diff. places Reply to topic Reply with quote

Code: Show/Hide
   case EVENT_Tick:
      {
            if (countdown[0] == 0) { // assuming countdown[0] initialized to > 0  in spawn.h, freqchange=0;
                _listnode <Player> *parse = playerlist->head;
                int count = 0;

                while (parse)
                {
                    Player *p = parse->item;

                    if (p->ship != SHIP_Spectator)
                    ++count;

                    parse = parse->next;
                }

                if ((count = 4) && (freqchange != 2))
                {
                    sendPublic("?set team:maxperteam:2");
               sendPublic("*lock");
                    String s;
                    s = "Max freq size 2 (";
                    s += count;
                    s += " pilots in game)";
                    sendPublic(s);
               sendPublic("Game will start in 10 seconds...");
                    freqchange = 2;
               countdown[1] = 10;
                }
         countdown[0] = 5;
         }
            if(countdown[1] == 0) { //Starts game
         //Warps players
         }
      }
      break;

what code do i need (//warp players) to warp all 4 playing players to 4 different places?
so:
player 1 of freq 0: 497, 488
player 2 of freq 0: 534, 488
player 1 of freq 1: 497, 532
player 2 of freq 1: 534, 532
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
tikiman
Newbie


Joined: Jan 25 2003
Posts: 14
Offline

PostPosted: Sat Aug 02, 2003 5:32 am    Post subject: Reply to topic Reply with quote

Heres what I would do as long as you know you have 2 players on each freq 0 and 1:

Code: Show/Hide
// warps players
bool warped_freq0_player = false;
bool warped_freq1_player = false;

_listnode <Player> *parse = playerlist->head;
while (parse)
{
   Player *p = parse->item;
   if (p->team == 0)
   {
      if (warped_freq0_player)
         sendPrivate(p, "*warpto 534 488");
      else
      {
         sendPrivate(p, "*warpto 497 488");
         warped_freq0_player = true;
      }
   }
   else if (p->team == 1)
   {
      if (warped_freq1_player)
         sendPrivate(p, "*warpto 534 532");
      else
      {
         sendPrivate(p, "*warpto 497 532");
         warped_freq1_player = true;
      }
   }

   parse = parse->next;
}


Hope this helps.
Back to top
View users profile Send private message Add User to Ignore List
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: 126 page(s) served in previous 5 minutes.

phpBB Created this page in 0.541995 seconds : 27 queries executed (89.4%): GZIP compression disabled