Raised This Month: $ Target: $400
 0% 

Multijumps - Only Counter-Terrorists


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bombey
Member
Join Date: Jul 2006
Old 04-16-2009 , 11:30   Multijumps - Only Counter-Terrorists
Reply With Quote #1

Hi,

Could someone rewrite this .sma so that only the cts are able to use multijumps?

In return I will give you +karma
Attached Files
File Type: sma Get Plugin or Get Source (multijump.sma - 737 views - 1.5 KB)
__________________
I'm the creator of:
-zm_lila_panic_cs
, zm_office


bombey is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 04-16-2009 , 11:39   Re: Multijumps - Only Counter-Terrorists
Reply With Quote #2

PHP 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","1")
    
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) || get_user_team(id) != 2) 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

__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
bombey
Member
Join Date: Jul 2006
Old 04-16-2009 , 12:42   Re: Multijumps - Only Counter-Terrorists
Reply With Quote #3

first of all thanks for the fast answer
I've tested it but I still can multijump as a Terrorist?
__________________
I'm the creator of:
-zm_lila_panic_cs
, zm_office


bombey is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:48.


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