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
Two Questions

 
Post new topic   Reply to topic Printable version
 View previous topic  basewars plugin Post :: Post Hockey Plugin  View next topic  
Author Message
JaqMs14
Guest


Offline

PostPosted: Tue Jul 13, 2004 2:20 pm    Post subject: Two Questions Reply to topic Reply with quote

I have two questions in creating a plugin:

1. How do I save a player name for later use (ex. !flag will display the person that is carrying the flag)

2. Is there a way to make someone's name red without any flags?
Back to top
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Jul 13, 2004 2:45 pm    Post subject: Reply to topic Reply with quote

To store data, use variables. If you want a variable to survive longer than the scope of a function, put it outside the function. For MERVCORE an ideal place is in the botInfo class definition.

You can change font color using .lvz, although it would change a complete color... like you could make yellow red... but then team chat would be red.

With ASSS you can modify packets to it looks like people are carring flags when they really aren't.
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Tue Jul 13, 2004 3:03 pm    Post subject: Reply to topic Reply with quote

Bah, I was typing something like that, but you were faster than me Bak. icon_sad.gif

Guess VNC'ing to home and trying to post on forums isn't such a good idea. icon_razz.gif
Back to top
View users profile Send private message Add User to Ignore List
Underlord
Novice


Gender:Gender:Male
Joined: Feb 17 2004
Posts: 55
Offline

PostPosted: Tue Jul 13, 2004 3:04 pm    Post subject: Reply to topic Reply with quote

1. MervBot tracks who has flags internally with p->flagCount

So to have !flag display who has flags (command.cpp in gotCommand)

Code: Show/Hide

if (c->check("flag"))
         {
            _listnode <Player> *parse = playerlist->head;
   
            while (parse)
            {
               Player *t = parse->item;

               if (t->flagCount > 0)
               {
                  String s = t->name;
                  s += " flags: ";
                  s += t->flagCount;
                  sendPrivate(p,s);
               }
               parse = parse->next;

            }
         }


Assuming 1 flag in the arena, to store a global name of who has it....

(spawn.h)
class botInfo
{
char flagCarrier[20];

(spawn.cpp)
Code: Show/Hide

Code: Show/Hide

case EVENT_FlagGrab:
      {
         Player *p = (Player*)event.p[0];
         Flag *f = (Flag*)event.p[1];

          strcpy(flagCarrier,p->name);



You'd need to handle what to do if they drop the flag.


2. Not with subgame
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: 84 page(s) served in previous 5 minutes.

phpBB Created this page in 0.510384 seconds : 28 queries executed (95.5%): GZIP compression disabled