AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Lock and jump squats (https://forums.alliedmods.net/showthread.php?t=253471)

artist 12-22-2014 19:14

Lock and jump squats
 
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_forward(FM_PlayerPreThink, "player_think", 1) } public player_think(id) {     static button; button = pev(id, pev_button)         if(button & IN_DUCK) set_pev(id, pev_button, button &~ IN_DUCK)     if(button & IN_JUMP) set_pev(id, pev_button, button &~ IN_JUMP) }

Not working...

zmd94 12-22-2014 22:39

Re: Lock and jump squats
 
So, you want to restrict IN_DUCK and IN_JUMP function?

artist 12-23-2014 03:52

Re: Lock and jump squats
 
Yes ))

Watched for mp.dll sourse:

Code:
void CBasePlayer::PreThink(void) {     ...         if (pev->button & IN_JUMP)         Jump();     if ((pev->button & IN_DUCK) || FBitSet(pev->flags, FL_DUCKING) || (m_afPhysicsFlags & PFLAG_DUCKING))         Duck();     .... }

zmd94 12-23-2014 03:57

Re: Lock and jump squats
 
This plugin will restrict player from jump:
PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("No-Jump"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
}

public 
Player_Jump(id)
{
    static 
iOldbuttons iOldbuttons entity_get_int(idEV_INT_oldbuttons)
    if( !(
iOldbuttons IN_JUMP) )
    {
        
entity_set_int(idEV_INT_oldbuttonsiOldbuttons IN_JUMP)
        return 
HAM_HANDLED
    
}
    return 
HAM_IGNORED




All times are GMT -4. The time now is 15:26.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.