AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+karma) (https://forums.alliedmods.net/showthread.php?t=92241)

ramiax 05-12-2009 06:31

[HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+karma)
 
Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zombieplague>
#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false
public plugin_init()
{
    register_plugin("MultiJump","1.1","twistedeuphoria")
    register_cvar("amx_maxjumps","1")
    register_cvar("amx_mjadminonly","1")
}

public client_putinserver(id)
{
    jumpnum[id] = 0
    dojump[id] = false
}

public client_disconnect(id)
{
    jumpnum[id] = 0
    dojump[id] = false
}

public client_PreThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE
    if((zp_get_user_zombie(id)) && (zp_get_user_nemesis(id)))
    {
    jumpnum[id] = 0
    dojump[id] = false
    return PLUGIN_CONTINUE
    }
    if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    new nbut = get_user_button(id)
    new obut = get_user_oldbutton(id)
    if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
    {
        if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
        {
            dojump[id] = true
            jumpnum[id]++
            return PLUGIN_CONTINUE
        }
    }
    if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        jumpnum[id] = 0
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE
    if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    if(dojump[id] == true)
    {
        new Float:velocity[3]   
        entity_get_vector(id,EV_VEC_velocity,velocity)
        velocity[2] = random_float(265.0,285.0)
        entity_set_vector(id,EV_VEC_velocity,velocity)
        dojump[id] = false
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}

It's a multijump plugin remake:
http://forums.alliedmods.net/showthr...ight=multijump

I've just remaked it for zm, that only humans can have it, but the only problem is that it jumps 3 times, but i need just twice!
Plz help me!:) (+karma)
Sry for my english... :D

Arkshine 05-12-2009 06:44

Re: [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+ka
 
Again you. I will give the same answer, it's the value of amx_maxjumps which will determine the number of jumps. Don't know why you get 3 times, but the sole reason is you have probably somewhere in your config "amx_maxjumps 3"

ramiax 05-12-2009 07:56

Re: [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+ka
 
Again im telling you that the cvar is not the problem becouse its 1 so it have to make doublejump not triple! :(

Exolent[jNr] 05-12-2009 20:35

Re: [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+ka
 
Quote:

Originally Posted by arkshine (Post 826087)
but the sole reason is you have probably somewhere in your config "amx_maxjumps 3"


Osviux 05-12-2009 23:33

Re: [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+ka
 
Quote:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <zombieplague>
#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false
public plugin_init()
{
register_plugin("MultiJump","1.1","twistedeup horia")
register_cvar("amx_maxjumps","2")
register_cvar("amx_mjadminonly","1")
}

public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}

public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}

public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if((zp_get_user_zombie(id)) && (zp_get_user_nemesis(id)))
{
jumpnum[id] = 0
dojump[id] = false
return PLUGIN_CONTINUE
}
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity )
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity )
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

ramiax 05-16-2009 07:23

Re: [HELP!]Need help for zm multijump plugin!It should jump 2 times but it jumps3(+ka
 
Quote:

Originally Posted by twistedeuphoria (Post 88160)
This plugin will allow you to jump in the air a defined number of times.

Cvars:
amx_maxjumps (default 1) - Set the amount of times you can jump ( this does not include the normal jump )
amx_mjadminonly (default 0; 1|0) - Set whether or not only admins can use MultiJump.

Defines:
ADMINACCESS (default ADMIN_CHAT) - Set access required to use MultiJump if amx_mjadminonly is 1.

As you can see "( this does not include the normal jump )" it does not include the normal jump, so for doublejump it have to be 1, becouse if its 2 its triple... Mine is 1 but it still does triple... ;(


All times are GMT -4. The time now is 01:32.

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