AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking jumping (https://forums.alliedmods.net/showthread.php?t=94453)

yetj 06-11-2009 13:35

Blocking jumping
 
Hello,
I need plugin, which will block jumping.
Anyone can help me and to write such plugin?
Greetings

Emilioneri 06-11-2009 15:35

Re: Blocking jumping
 
PHP Code:

/* Plugin generated by Emilioneri */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Block Jump"
#define VERSION "1.0"
#define AUTHOR "Emilioneri"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_clcmd("+jump""BlockJump")
    
register_clcmd("-jump""BlockJump")
}

public 
BlockJump(id)
{
    return 
PLUGIN_HANDLED



xPaw 06-11-2009 15:37

Re: Blocking jumping
 
Emilioneri And you really think what it will work?

TitANious 06-11-2009 15:38

Re: Blocking jumping
 
Give an example then xPawn

yetj 06-11-2009 16:24

Re: Blocking jumping
 
Emilioneri, this isn't work. -.-

tpt 06-11-2009 16:55

Re: Blocking jumping
 
Here you go,

Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "block jumping" #define VERSION "1.0" #define AUTHOR "tpt" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_forward( FM_CmdStart, "fwd_cmdstart" ); } public fwd_cmdstart( id, uc_handle, random_seed ) {     static button; button = get_uc( uc_handle, UC_Buttons );         if( button & IN_JUMP )     {         new Float:fVel[ 3 ];         pev( id, pev_velocity, fVel );         fVel[ 2 ] = float( -abs( floatround( fVel[ 2 ] ) ) )         set_pev( id, pev_velocity, fVel )     } }

xPaw 06-11-2009 17:10

Re: Blocking jumping
 
Stuff with velocity just shit

Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_forward( FM_CmdStart, "fwd_cmdstart" ); } public fwd_cmdstart( id, uc_handle, random_seed ) {     static buttons; buttons = get_uc( uc_handle, UC_Buttons );         if( buttons & IN_JUMP )     {     //  set_uc(uc_handle, UC_Buttons, buttons & ~IN_JUMP);         set_uc(uc_handle, UC_Buttons, ~IN_JUMP);     } }

Bugsy 06-11-2009 17:11

Re: Blocking jumping
 
Already tried that xPaw, no workie.

tpt 06-11-2009 17:15

Re: Blocking jumping
 
Quote:

Originally Posted by xPaw (Post 846621)
Stuff with velocity just shit

Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_forward( FM_CmdStart, "fwd_cmdstart" ); } public fwd_cmdstart( id, uc_handle, random_seed ) {     static buttons; buttons = get_uc( uc_handle, UC_Buttons );         if( buttons & IN_JUMP )     {     //  set_uc(uc_handle, UC_Buttons, buttons & ~IN_JUMP);         set_uc(uc_handle, UC_Buttons, ~IN_JUMP);     } }

Velocity and gravity are only ways AFAIK. Gravity is better method but it can kill you easily. :wink:

Bugsy 06-11-2009 17:46

Re: Blocking jumping
 
Both ways are sloppy and not actually blocking jump.


All times are GMT -4. The time now is 13:57.

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