AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing/canceling JUMP event in NS (https://forums.alliedmods.net/showthread.php?t=12246)

Blackhawk 04-09-2005 16:28

Changing/canceling JUMP event in NS
 
I'm looking for a way to change the Jump behaviour in NS.
For the moment, i need to check if someones want to jump and 'disable' it if neccesary on a gived player. IE this jump he tryed should not be executed. But the next maybe has to work....

I try'd


Code:

public forward_playerprethink(id) {
    entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) & ~(IN_JUMP))
}

public plugin_init() {
        register_forward(FM_PlayerPreThink, "forward_playerprethink")
}

give from an example seen here in the forums, but if didn't work. Any ideas how i can change the jump event?

XxAvalanchexX 04-09-2005 22:08

Try it with Engine:

Code:
public client_PreThink(id) {    if(!is_user_alive(id)) {       return PLUGIN_CONTINUE;    }    new button = get_user_button(id);    if(button & IN_JUMP) {       entity_set_int(id,EV_INT_button,button & ~IN_JUMP);    }    return PLUGIN_CONTINUE; }

v3x 04-10-2005 00:34

Dumb question.. What does the ~ do?

Blackhawk 04-10-2005 18:59

Whatever, i'm sorry to say that this solution didn't work as expected in NS :?

Twilight Suzuka 04-10-2005 22:31

FM doesnt work right a lot of times. Use Engine.


All times are GMT -4. The time now is 10:02.

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