AlliedModders

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

abece 01-22-2009 17:07

Multijump
 
Hey, can help me with this plugin ? i want to make it gest ct`s only .
Code:

include <amxmodx>
#include <amxmisc>
#include <engine>

#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","6")
    register_cvar("amx_mjadminonly","0")
}

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(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
}


anakin_cstrike 02-28-2009 14:25

Re: Multijump
 
Post in suggestions forum.
Just add this:
Code:
if( get_user_team( id ) == 1 ) return PLUGIN_CONTINUE;
in pre and post think forward.

SnoW 02-28-2009 15:58

Re: Multijump
 
Quote:

Originally Posted by anakin_cstrike (Post 771107)
Post in suggestions forum.

He shouldn't post to Suggestions and requests forum. He's wanting that someone helps him editing some code, he doesn't know how to do it and ye he's posting correctly here. What he isn't doing is requesting a new plugin, or suggesting some new plugin idea.


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

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