Server Help

ASSS Custom Projects - ?moveto (cypher read this)

Anonymous - Tue Jun 29, 2004 5:18 pm
Post subject: ?moveto (cypher read this)
Like ?warpto but moves players without speedloss. Note: not tested thoroughly.
Code: Show/Hide
local helptext_t moveto_help =
"Targets: player, freq, or arena\n"
"Args: <x coord> <y coord>\n"
"Moves target player to coordinate x,y.\n";
Don't complain about weapons that are fired after being moved being offset noticeably.
CypherJF - Tue Jun 29, 2004 6:23 pm
Post subject:
ty much!

next step: getting it to compile biggrin.gif lol.. thanks again.
Anonymous - Mon Jan 03, 2005 10:24 am
Post subject:
Updated for 1.3.2
Code: Show/Hide
--- moveto.c.0   2005-01-03 15:17:31.000000000 +0000
+++ moveto.c   2005-01-03 15:17:50.000000000 +0000
@@ -5,12 +5,17 @@
  *
  * 29/06/04 - Started by Smong (to prove writing modules is easy).
  *
+ * 01/07/04 - Changed SPEC to SHIP_SPEC.
+ *
+ * 03/01/05 - Updated for asss 1.3.2.
+ *
  */

#include <stdlib.h>
#include "asss.h"

-local void Cmoveto(const char *params, Player *p, const Target *target);
+local void Cmoveto(const char *command, const char *params, Player *p,
+   const Target *target);

local void do_checksum(struct S2CWeapons *pkt);
local void move_player(Player *p, int x, int y, ticks_t delta);
@@ -48,7 +53,8 @@
"Args: <x coord> <y coord>\n"
"Moves target player to coordinate x,y.\n";

-local void Cmoveto(const char *params, Player *p, const Target *target)
+local void Cmoveto(const char *command, const char *params, Player *p,
+   const Target *target)
{
   char *next;
   int x, y;
@@ -70,12 +76,14 @@
   for (l = LLGetHead(&set); l; l = l->next)
   {
      p = l->data;
-      if (p->p_ship == SPEC || !IS_STANDARD(p)) continue;
+      if (p->p_ship == SHIP_SPEC || !IS_STANDARD(p)) continue;

      move_player(p, x, y, now);
   }
}

+EXPORT const char info_moveto[] = "v1.1 smong <soinsg@hotmail.com>";
+
EXPORT int MM_moveto(int action, Imodman *mm_, Arena *arena)
{
   if (action == MM_LOAD)
@@ -85,12 +93,12 @@
      cmd = mm->GetInterface(I_CMDMAN, ALLARENAS);
      pd = mm->GetInterface(I_PLAYERDATA, ALLARENAS);
      if (!net || !cmd || !pd) return MM_FAIL;
-      cmd->AddCommand("moveto", Cmoveto, moveto_help);
+      cmd->AddCommand("moveto", Cmoveto, ALLARENAS, moveto_help);
      return MM_OK;
   }
   else if (action == MM_UNLOAD)
   {
-      cmd->RemoveCommand("moveto", Cmoveto);
+      cmd->RemoveCommand("moveto", Cmoveto, ALLARENAS);
      mm->ReleaseInterface(net);
      mm->ReleaseInterface(cmd);
      mm->ReleaseInterface(pd);

You can now get it from here too http://toktok.sscentral.com/ss-asss.html
CypherJF - Mon Jan 03, 2005 1:54 pm
Post subject:
w00t. ty biggrin.gif
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group