Poll

Which is better

Toggle-Able Ground
22 (62.9%)
"No Ground" Ground
13 (37.1%)

Total Members Voted: 35

Author Topic: Toggle the Ground by Pacnet2012 v3 - Fixed, unwanted useless messages removed.  (Read 8566 times)

Toggle the Ground Mod v3 by Pacnet2012
Some credit to Bushido for a script that kills you when you fall too low in a map with the ground removed.
As suggested in this topic.

Features :
  • /toggleGround to remove / add the ground back.
  • Client / Server side mod : Adds a button to your client's Environment Gui in the corner (so you don't click on accident) to toggle the ground.
  • Set permissions - Let only Admins, Super Admins or the Host be able to toggle the ground (By default it's the Host).
  • Help mod - Learn to use the mod by typing /groundHelp
  • Auto-Killer once you fall through the map too much.

Commands :

/toggleGround - Toggles the ground.
/groundPerm [level] - Allows only [level] to use the mod. Replace [level] with 1 for Admin, 2 for SA, 3 for host.
/groundHelp - Tells you how to use the mod.


Picture :


Changelog :
  • v1 to v2 : Bushido's Height Script added.
  • v2 to v3 : Fixed height script killing everyone, and removed unwanted server-wide messages and fixed position of the Toggle Ground button in your Environment Gui.
« Last Edit: October 03, 2012, 08:46:50 PM by Pacnet2012³ »


by the way:

Quote
$minHeight = 10;
 
function heightCheck()
{
        for(%i = 0; %i < ClientGroup.getCount(); %i++)
        {
                %cl = ClientGroup.getObject(%i);
                if(isObject(%cl.player) && getWord(%cl.player.getPosition(), 2) < $minHeight)
                        %cl.player.kill();
        }
       
        if(!isEventPending($heightCheckSched))
                $heightCheckSched = schedule(500, 0, "heightCheck");
}
 
heightCheck();


you know you'll have to edit minheight, because the instant kill zone is actually ABOVE ground level

and you can also edit minheight, so that'd be a great RTB pref

It's incredible to see such a simple concept implemented in such a loving terrible way.

All users on the server need to be notified that the server is running your mod? All users need to be told the ground has been removed despite it being pretty goddamn obvious? All users need to be notified that the permission requirement for ground removal has been changed? Executing a script each time someone wants to toggle the ground? The kill loop continues to run even when the ground is on?

Come on, this is amateur bullstuff even for you.

admittedly the last part is probably more of an oversight then a straight-up coding flaw

All users on the server need to be notified that the server is running your mod?
I always hate it when I see something like this in an Add-On. If I really cared, I would ask which one did whatever it did.

That is one big ass explanation.

admittedly the last part is probably more of an oversight then a straight-up coding flaw

It's not even that, you've given him a basic script and instead of him thinking about it and maybe considering it's impact he's just thrown it in and moved on - demonstrated by the fact the kill zone was above ground level and if he'd even loaded the script on his own server before releasing it as a WORKING ADD-ON he'd realise it's broken.

One time we will join a server and see 100messages who made which addon and get spammed by notifications.

You can now get Version 3 :
Changelog :
  • v2 to v3 : Fixed height script killing everyone, and removed unwanted server-wide messages, also client environment-gui button has been positioned correctly.
« Last Edit: October 02, 2012, 08:28:49 PM by Pacnet2012³ »

Reenabling ground should make a ground with the current environment settings for ground (texture, color, etc) instead of some random preset you defined.

Why are the notifications in such a huge font wtf

And some parts of the script are rather...wordy (for lack of a better word)
« Last Edit: October 03, 2012, 12:54:32 AM by Headcrab Zombie »

use servercmdenvgui_setvar(%client, "groundcolor", "1 1 1 0"); to make the ground shadow go away.
Assuming %client is an admin

I've always just manually deleted the ground through console, never needed to bring it back.