A little topic for you to share snippets for others to use.
How to post a snippet:
Function Name:
Function Description:
Usage Guide:
Access Level:
Code:
I do not offer support on any of these codes, if any of these codes do not work you may make one post in this topic asking for help for that code. Make sure you added the error and the function name of the code you used when reporting an error.
Do not post hacking scripts that will take control of any server. Do not post spam script, or any abusive scripts. Doing this may get you subject to ban by Badspot.
DO NOT ASK HOW TO SCRIPT WHEN POSTING IN THIS TOPIC, THIS TOPIC IS FOR SNIPPETS ONLY. YOU MAY ASK FOR HELP ONE OR TWO TIMES IN THIS TOPIC FOR A FUNCTION. IF YOU DON'T GET A REPLY START A NEW TOPIC. THIS TOPIC IS NOT FOR CHIT-CHAT, FLAME, OR ANY OTHER CRAP TALK THAT PUTS A MEMBER DOWN. IF YOU FEEL THIS IS WRONG LOOK AT THE RULES.
Function Name: Admin Jump
Function Description: Make you jump really high. (Warps you up). Code is a bit old. A few months old.
Access Level: Admin Only
Usage Guide: commandtoserver('AdminJump, 300); // 300 is the height
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!");
}
}