Prevent Double Jump
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
What if somebody's falling for a while and double jumps right before they hit the ground? It might be longer than just X seconds.

My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.

Something like this?Works with CS:S (Windows).
Syntax: Select all
import memory
from memory import Convention
from memory import DataType
from memory.hooks import PreHook
from players.entity import Player
server = memory.find_binary('server')
CreateInterface = server['CreateInterface'].make_function(
Convention.CDECL,
[DataType.STRING, DataType.POINTER],
DataType.POINTER
)
g_pGameMovement = CreateInterface('GameMovement001', None)
# CCSGameMovement::OnLand(float)
OnLand = g_pGameMovement.make_virtual_function(
26,
Convention.THISCALL,
[DataType.POINTER, DataType.FLOAT],
DataType.VOID
)
@PreHook(OnLand)
def pre_on_land(args):
player = memory.make_object(Player, args[0].get_pointer(3744))
print('%s landed!'% player.name, args[1])
Just tested this abit and found out that this is not the best way or pretty useless.
so lets say the pre_on_land fires this function
And we have this for jumps (fired by player_jump event)
But in the end it always show
Mhm
so lets say the pre_on_land fires this function
Syntax: Select all
def onGround(self):
self.stagejumps = 0
self.totaljumps = 0
And we have this for jumps (fired by player_jump event)
Syntax: Select all
def jumpEvent(self):
self.jumps+= 1
But in the end it always show
self.jumps = 1
Mhm
Re:
Ayuto wrote:Something like this?Works with CS:S (Windows).Syntax: Select all
import memory
from memory import Convention
from memory import DataType
from memory.hooks import PreHook
from players.entity import Player
server = memory.find_binary('server')
CreateInterface = server['CreateInterface'].make_function(
Convention.CDECL,
[DataType.STRING, DataType.POINTER],
DataType.POINTER
)
g_pGameMovement = CreateInterface('GameMovement001', None)
# CCSGameMovement::OnLand(float)
OnLand = g_pGameMovement.make_virtual_function(
26,
Convention.THISCALL,
[DataType.POINTER, DataType.FLOAT],
DataType.VOID
)
@PreHook(OnLand)
def pre_on_land(args):
player = memory.make_object(Player, args[0].get_pointer(3744))
print('%s landed!'% player.name, args[1])
Sorry to dig up an old topic, but could you please explain how you found 3744 as the offset for the player pointer?
Re: Prevent Double Jump
CCSGameMovement::OnLand() is quite simple. All it does is calling CCSPlayer::OnLand(). To do that it needs the player instance (CCSPlayer). It's retrieved by accessing this+0x0EA0 (3744).
Syntax: Select all
.text:002E7410 ; CCSGameMovement::OnLand(float)
.text:002E7410 _ZN15CCSGameMovement6OnLandEf proc near ; DATA XREF: .rodata:`vtable for'CCSGameMovemento
.text:002E7410
.text:002E7410 arg_0 = dword ptr 8
.text:002E7410
.text:002E7410 55 push ebp
.text:002E7411 89 E5 mov ebp, esp
.text:002E7413 8B 45 08 mov eax, [ebp+arg_0]
.text:002E7416 8B 80 A0 0E 00 00 mov eax, [eax+0EA0h]
.text:002E741C 89 45 08 mov [ebp+arg_0], eax
.text:002E741F 5D pop ebp
.text:002E7420 E9 1B 53 01 00 jmp _ZN9CCSPlayer6OnLandEf ; CCSPlayer::OnLand(float)
.text:002E7420 _ZN15CCSGameMovement6OnLandEf endp
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 82 guests