AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help with MJ (MultiJump) (https://forums.alliedmods.net/showthread.php?t=111717)

tomax079 12-13-2009 08:18

Need help with MJ (MultiJump)
 
1 Attachment(s)
Hello every1 as you see in title i need help with MJ. What i need?
1. That T's and CT's could use MJ (Now can use only CT)
2. That it will work only admins whose have flag "l"

lazarev 12-13-2009 08:20

Re: Need help with MJ (MultiJump)
 
flag "l" = ADMIN_RCON
PHP Code:

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

#define ADMINACCESS ADMIN_RCON

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
    
register_plugin("MultiJump","1.1","twistedeuphoria")
    
register_cvar("amx_maxjumps","5")
    
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(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) || get_user_team(id) != 2) 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



tomax079 12-13-2009 08:27

Re: Need help with MJ (MultiJump)
 
Thanks! :)

tomax079 12-19-2009 03:16

Re: Need help with MJ (MultiJump)
 
If i want MJ for T's and CT's it must be like this:
get_user_team(id) != 1 , 2) or how?

ConnorMcLeod 12-19-2009 04:23

Re: Need help with MJ (MultiJump)
 
3 Attachment(s)
http://forums.alliedmods.net/showthr...15#post1022215

tomax079 12-19-2009 04:28

Re: Need help with MJ (MultiJump)
 
Thanks.
+k

malec321 12-19-2009 17:02

Re: Need help with MJ (MultiJump)
 
get_user_team(id) != 1 , 2) nah that wouldnt work


All times are GMT -4. The time now is 07:39.

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