Raised This Month: $ Target: $400
 0% 

Need help with the get_user_button(id)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-05-2009 , 07:49   Re: Need help with the get_user_button(id)
Reply With Quote #1

PHP Code:
#include <amxmodx>

#define MAX_INTERVAL    0.5

#define MAX_PLAYERS 32

new Float:g_fLastGameTimeDoprKeyPressed[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_clcmd("drop""ClientCommand_Drop")
}

public 
ClientCommand_Dropid )
{
    if( 
is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE )
    {
        
// execute your code here
        
new Float:flGameTime get_gametime()
        if( 
flGameTime g_fLastGameTimeDoprKeyPressed[id] < MAX_INTERVAL )
        {
            
g_fLastGameTimeDoprKeyPressed[id] = 0.0
            
// execute code below
            
        
}
        else
        {
            
g_fLastGameTimeDoprKeyPressed[id] = flGameTime
        
}
        return 
PLUGIN_HANDLED // this prevent the message "can't drop this weapon" from showing
    
}
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 17:31.


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