Page 1 of 1

Client Console Disable Script!

Posted: Wed Sep 10, 2003 7:24 am
by The Jackal
Hey Guys! It's me again.

I wrote another useless script. This one disables clients' consoles so they cannot reload the map of demo SH servers (since the thoughful gents at EA did not see it fit to release a fix for it, as they did with the full version..

I am posting for your input and ideas.

Code: Select all

_console:

setcvar "level.console" "0"

while(1)
{
wait .1
local.console = getcvar "level.console"
for(local.p = 2; local.p < $player.size+1;local.p++)
	{
	if(local.console=="0")
		{
		 $player[local.p] stufftext ("ui_console 0")
		}
		else
		{
		 //$player[local.p] stufftext ("ui_console 1")	
		}

	}

wait (.2)
}
end
I noticed I got a stufftext command overflow from a client before he was disconnected. I don't know if my thread time was too short. Regardless, players cannot access their console to do mischief.

A sad thing is that persons can still reload the map IF they are familiar with the UI's and the stuffcommand. But this is mostly not the case.

I do not know crack about hex-editing the .dll file. Else I would.

Thanks you your input on the above script.

Posted: Wed Sep 10, 2003 6:19 pm
by jv_map
In my experience this script will crash a mohaa dedicated server (maybe not a sh one) within a couple of seconds :?

This is due to the fact that a dedicated server spawns a fake player which cannot receive stufftext commands and causes errors instead.

Bugga

Posted: Wed Sep 10, 2003 11:15 pm
by CorporalPunishment
So is there anyway to use STUFFTEXT in multiplayer which would not crash the server?

Or is it only to be used in single player?

Posted: Thu Sep 11, 2003 5:55 am
by jv_map
Well you can safely use it when you're sure there is no fake player anymore.

When a player joins the server he replaces the initial fake player. When he leaves no more fake players are added.

There are a few known properties of this annoying fake player:
dmteam = spectator
velocity = (0 0 0)

I don't remember exactly the values for lots of other variables, but you can easily find them out by making a test script.

Anyway, this means that if a player is not a spectator you can safely stufftext him. If he is a spectator you can check whether his velocity is (0 0 0). If there are more players on the server (more than 1) you can safely stufftext everyone (just don't spam 'em). :wink:

Posted: Fri Sep 12, 2003 5:57 am
by CorporalPunishment
Does that also apply when not using a player array?

ie. send to all

$player stufftext ("ui_console 0")

or should you always use stufftext with a player array?


Thanks JV

Posted: Fri Sep 12, 2003 6:06 am
by jv_map
Never tried :? but I think it's all the same.

Posted: Fri Sep 26, 2003 8:14 am
by The Jackal
On the subject of that clientside command that reloads the server map. I just added a fix for the SH Demo to the www.mohadmin.com downloads.

http://www.mohadmin.com/nuke/modules.ph ... mo_Bug_Fix