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
Flag Neuter

 
Post new topic   Reply to topic Printable version
 View previous topic  Simple region tools Post :: Post Loading a formula from an INI file  View next topic  
Author Message
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Jul 23, 2004 8:10 am    Post subject: Flag Neuter Reply to topic Reply with quote

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

_________________
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 34 time(s)
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
50% Packetloss
Server Help Squatter


Age:39
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Fri Jul 23, 2004 10:10 am    Post subject: Reply to topic Reply with quote

Thx brain, <3
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Sat Jul 24, 2004 2:11 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jul 24, 2004 6:19 pm    Post subject: Reply to topic Reply with quote

?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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Sat Jul 24, 2004 6:41 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Jul 24, 2004 9:44 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects 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: 672 page(s) served in previous 5 minutes.

phpBB Created this page in 0.532607 seconds : 33 queries executed (82.0%): GZIP compression disabled