Author |
Message |
JaqMs14 Guest
Offline
|
Posted: Tue Jul 13, 2004 2:20 pm Post subject: Two Questions |
 |
|
|
|
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: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Tue Jul 13, 2004 2:45 pm Post subject: |
 |
|
|
|
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 |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Tue Jul 13, 2004 3:03 pm Post subject: |
 |
|
|
|
Bah, I was typing something like that, but you were faster than me Bak.
Guess VNC'ing to home and trying to post on forums isn't such a good idea.  |
|
Back to top |
|
 |
Underlord Novice
Gender: Joined: Feb 17 2004 Posts: 55 Offline
|
Posted: Tue Jul 13, 2004 3:04 pm Post subject: |
 |
|
|
|
1. MervBot tracks who has flags internally with p->flagCount
So to have !flag display who has flags (command.cpp in gotCommand)
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)
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 |
|
 |
|