Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- #include <engine>
- #include <rpgx>
- #include <rpgx_multijump>
- #define PLUGIN "Jump height modifier"
- #define VERSION "0.0.1"
- #define AUTHOR "striker07"
- new upgrade_id;
- new jumpnum[33];
- new dojump[33];
- //new level;
- //ew mjlevel;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- RegisterHam(Ham_Player_Jump, "player", "fwdPlayerJump");
- }
- public RPGx_OnPluginReady()
- upgrade_id = RPGx_MakeUpgrade("High Jump", 5, 10, 20);
- public client_PreThink(id)
- {
- if(is_user_alive(id))
- {
- new buttons = get_user_button(id);
- new obut = get_user_oldbutton(id);
- new mjlevel = RPGx_GetUpgradeLevel_MJ(id);
- if( mjlevel > 0)
- {
- if((buttons & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
- {
- if(jumpnum[id] < mjlevel)
- {
- dojump[id] = true;
- jumpnum[id]++;
- client_print(id, print_chat, "+1 jump");
- return PLUGIN_CONTINUE;
- }
- }
- if((buttons & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0;
- client_print(id, print_chat, "landed= jumps reset");
- }
- }
- }
- return PLUGIN_CONTINUE;
- }
- public client_PostThink(id)
- {
- if(is_user_alive(id))
- {
- new level = RPGx_GetUpgradeLevel(id, upgrade_id);
- if( level > 0 && dojump[id] )
- {
- /*static Float:velocity[3];
- pev(id, pev_velocity, velocity);*/
- new Float:velocity[3];
- entity_get_vector(id,EV_VEC_velocity,velocity);
- velocity[2] = velocity[2] * ( 1.0+ (0.5*level) )
- //set_pev(id, pev_velocity, velocity)
- entity_set_vector(id,EV_VEC_velocity,velocity);
- client_print(id, print_chat, "Debug: Jumped higher then usual");
- dojump[id] = false;
- return PLUGIN_CONTINUE;
- }
- }
- return PLUGIN_CONTINUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement