Client Console Disable Script!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Client Console Disable Script!

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Bugga

Post 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?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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:
Image
User avatar
CorporalPunishment
Sergeant
Posts: 62
Joined: Mon May 19, 2003 5:25 am

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Never tried :? but I think it's all the same.
Image
User avatar
The Jackal
Sergeant Major
Posts: 101
Joined: Wed May 07, 2003 10:09 am
Contact:

Post 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
Post Reply