Author Topic: [Snippet] Admin Jump  (Read 1675 times)

I saw Badspot do an Admin jump in Age of Time so I thought I will try to make one.  It's not the best way to do it but it works.  I only made this for the players that cannot script.

Simply make an add-on or something for it.

Code: [Select]
function servercmdAdminJump(%client, %height)
  {
  if(%client.isSuperAdmin)
     {
    %error["Same Spot"] = echo("Player wants to jump to the same spot!");
    %id = %client.player;
    %trans = %id.getTransform();
    %x = getWord(%trans,0);
    %y = getWord(%trans,1);
    %z = getWord(%trans,2);
    %z[1] = getWord(%trans,2);
    %z+=%hight;
    $trans[1] = %x SPC %y SPC %z;
     if(%z[1] == %height)
         {
         messageClient(%client,"Jump Error","\c3Silly you, how can you jump to the same spot?");
         return %error["Same Spot"];
         }
    %id.setTransform($trans[1]);
    messageClient(%client,"Jump","Jumping...");
  }
  else
   {
    error("Error: Player" SPC "(" SPC %client.getAddress() SPC "\c2)" SPC " called an admin command!\nThis player is not an admin!");
  }
}

I will have to post a updated code later to get the player from jumping below the terrain and stuff.  It's 4AM here now.
« Last Edit: August 09, 2007, 11:35:07 AM by Dr-Block »

Here is the new code.

Code: [Select]
function servercmdAdminJump(%client, %height)
  {
  if(%client.isSuperAdmin == True)
     {
    %error = "Player did not enter a valid hight!";
    %error[2] = "Player wants to jump below the terrain!";
    %id= %client.player;
    %trans = %id.getTransform();
    %x = getWord(%trans,0);
    %y = getWord(%trans,1);
    %z = getWord(%trans,2);
    %z[1] = getWord(%trans,2);
    %terheight = getTerrainHeight(%z[1]);
    %terheight-=1;
    %z+=%height;
    $trans[1] = %x SPC %y SPC %z;
     if(%z[1] == %height)
         {
         messageClient(%client,"Jump Error","\c3Enter a valid hight!");
         return %error;
         }
         else if(%hight < %terheight)
         {
         messageClient(%client,"Jump Error","\c3You cannot jump below the terrain!");
         return %error[2];
         }
    %id.setTransform($trans[1]);
  }
  else if(%client.isSuperAdmin == False)
   {
    error("Error: Player" SPC "(" SPC %client.getAddress() SPC "\c2)" SPC " called an admin command!\nThis player is not an admin!");
  }
}
« Last Edit: August 09, 2007, 11:35:59 AM by Dr-Block »


Makes you jump real high.  /AdminJump 200


What if there is fall damage on?
FG has a point, if you're an admin, you have no need to jump high.
It would be fun to have it in a minigame as a player option, but I have already done that.

I think the "Age of Time High Jump" is just an edit to the player datablock, giving faster run, jump, etc rather than an instant warp very high up.

I remember seeing the "AdminPlayer" datablock (or similar) in v3, in a method of making Super Horses in that version.

Code: [Select]
    if(%client.isSuperAdmin == True)
    {
     ...
   }
  else if(%client.isSuperAdmin == False)
   {
     ...
   }
The second if wasn't really needed, since if it's Not True then it will equal false, always.

I still wanted to add it.