Author |
Message |
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Jul 23, 2004 8:10 am Post subject: Flag Neuter |
|
|
|
|
Here is a flag neuting module for anyone who wants it. I attached it as well for those who don't like copy+paste.
Neuts any flag dropped in the region "noflags".
#include "../asss.h"
local Ilogman *lm;
local Iflags *flags;
local Imapdata *mapdata;
local void FlagPos(Arena *arena, int fid, int x, int y, int freq)
{
if (mapdata->InRegion(arena, "noflags", x, y))
{
//lm->LogA(L_DRIVEL, "hs_flagmover", arena, "Neuting flag %i", fid);
ArenaFlagData *fd = flags->GetFlagData(arena);
fd->flags[fid].state = FLAG_NONE;
flags->ReleaseFlagData(arena);
}
}
EXPORT int MM_hs_flagmover(int action, Imodman *mm, Arena *arena)
{
if (action == MM_LOAD)
{
lm = mm->GetInterface(I_LOGMAN, ALLARENAS);
flags = mm->GetInterface(I_FLAGS, ALLARENAS);
mapdata = mm->GetInterface(I_MAPDATA, ALLARENAS);
if (!lm || !flags || !mapdata)
{
mm->ReleaseInterface(lm);
mm->ReleaseInterface(flags);
mm->ReleaseInterface(mapdata);
return MM_FAIL;
}
return MM_OK;
}
else if (action == MM_UNLOAD)
{
mm->ReleaseInterface(lm);
mm->ReleaseInterface(flags);
mm->ReleaseInterface(mapdata);
return MM_OK;
}
else if (action == MM_ATTACH)
{
mm->RegCallback(CB_FLAGPOS, FlagPos, arena);
return MM_OK;
}
else if (action == MM_DETACH)
{
mm->UnregCallback(CB_FLAGPOS, FlagPos, arena);
return MM_OK;
}
return MM_FAIL;
}
|
_________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
hs_flagmover.c - 1.23 KB
File downloaded or viewed 36 time(s)
|
|
Back to top |
|
|
50% Packetloss Server Help Squatter
Age:39 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Fri Jul 23, 2004 10:10 am Post subject: |
|
|
|
|
Thx brain, <3
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sat Jul 24, 2004 2:11 pm Post subject: |
|
|
|
|
Suggestions:
- Add a command to list flag locations (with their ID)
- Add a command to neurtal flags based on their coords (J12) or ID (from previous command). Should read a .conf option if to display who issued the command or not in a public announcement.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Jul 24, 2004 6:19 pm Post subject: |
|
|
|
|
?flaginfo takes care of the first.
The second was to confusing to understand. You either want ?neutflag or some kind of annoucement command.
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sat Jul 24, 2004 6:41 pm Post subject: |
|
|
|
|
Ok, so the first has already been covered. The second works like this:
Staff notices that flag #4 is in an unreachable place they didn't know about before. Instead of warping to there, or whatever, they instead can do a ?neutflag 4, which will cause your code to kick in and neutral that specific flag.
The configuration is so the sysop can set a setting in the arena.conf, in which if a staff member uses this command, it will do an announcement state that "A flag has been neutralized by NAME", or another option to just state that it was neutralized, but not say who issued the command.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Jul 24, 2004 9:44 pm Post subject: |
|
|
|
|
A slient version exists already in ?neutflag. As for the announcement... I don't think it's very useful, but none the less, it should be put in playercmd.c, not my neuter.
|
|
Back to top |
|
|
|