English anti button hack script

10 replies
Goto Page
To the start Previous 1 Next To the start
30.09.11 05:18:28 pm
Up
dmessn28
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function echo(id,...)
     s = ""
     for i,v in ipairs(arg) do
          s = s..tostring(v).." "
     end
     
     msg2(id,s)
end

addhook("usebutton","h_usebutton")
function h_usebutton(id,x,y)
     --echo(id,x*32,y*32)
     dir = entity(x,y,"int1")
     tg = entity(x,y,"trigger")     
     
     local px,py = x*32,y*32
     local minx,maxx,miny,maxy = px,px+32,py,py+32
     
     local playerx,playery = player(id,"x"),player(id,"y")
     
     if playerx < maxx and playerx > minx and playery < maxy and playery > miny then
          --echo(id,"valid trigger")
     else
          echo(id,"invalid trigger, hack detected!")
          parse("trigger "..tg) -- trigger again to undo
     end
end


This is for server hosters who were bothered by people that use the button hack.

Problem was that a button could be activated from large distance ( 10x10 tiles or sth) when using packet editing software. This script prevents that buttons can be used from large distance. It was very annoying in rpg and prison maps.
30.09.11 05:24:14 pm
Up
Yates
Reviewer
Offline Off
It works. And not that I have the hack, but I can explain how I know.
On cs2d, you can trigger a button 2 tiles away. Now, with this you can't. You HAVE to stand on that tile x y, which I find is better.

And that's how I know =3
05.10.11 04:37:11 am
Up
PyKemis
User
Offline Off
Yeah for prison maps they completely screw you over when they door kill you from a tile way.

I like this, thanks for posting.

Doesn't cs2d check automatically if you're allowed to press that button?
05.10.11 09:24:30 am
Up
dmessn28
User
Offline Off
user PyKemis has written:
Doesn't cs2d check automatically if you're allowed to press that button?


No, that's the whole problem of it. Current hacks abuse clientside teleportation to abuse the button/door hack.
You can press the button in a range of 5x5 tiles.
Can be used in prison maps, city life, deathrun, happy town etc.
05.10.11 01:02:12 pm
Up
MeyeM
BANNED
Offline Off
yeah
really thank you
its great work you do
yates use it in his server
but its so great idea
now uprate6 + Dr.Trojan can't use it in all servers ( if the servers use this script )
IMG:http://img104.herosh.com/2011/10/07/756594946.gif
IMG:http://www.maxforums.net/uploaded/62987/01317983471.gif
06.10.11 05:27:08 am
Up
PyKemis
User
Offline Off
Well it should have been implemented into the game to start with.

No more pressing a tile from a block away.
25.02.12 09:10:06 am
Up
dexiraz
User
Offline Off
Cool Script i love it Thank you !! √
26.02.12 01:52:07 pm
Up
danh
User
Offline Off
Very useful!
imma use it in mah rp server
02.03.12 07:09:15 pm
Up
Pirtyu
User
Offline Off
very useful
but where paste?
02.03.12 07:13:30 pm
Up
Yates
Reviewer
Offline Off
cs2d/sys/lua/server.lua
02.03.12 07:31:16 pm
Up
Pirtyu
User
Offline Off
oh ty
To the start Previous 1 Next To the start