Server Help

ASSS Custom Projects - Flag Neuter

Dr Brain - 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".

Code: Show/Hide

#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;
}

50% Packetloss - Fri Jul 23, 2004 10:10 am
Post subject:
Thx brain, <3
Mine GO BOOM - Sat Jul 24, 2004 2:11 pm
Post subject:
Suggestions:

Dr Brain - 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.
Mine GO BOOM - 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.
Dr Brain - 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.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group