Raised This Month: $ Target: $400
 0% 

[Solved] PrimaryAttack/SecondaryAttack


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 03-28-2014 , 19:00   [Solved] PrimaryAttack/SecondaryAttack
Reply With Quote #1

Hello, I need some help. When I write 'pri' I must use 'attack2' once and then PrimaryAttack for knife is blocked, and it's the same with SecondaryAttack. Question, what I need to do, that when I write 'pri' PrimaryAttack should be [un]blocked at the time, and when I write 'sec' SecondaryAttack should be [un]blocked at the time too?


PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
 
new boolblocked[33]
 
public 
plugin_init()
{
    
register_clcmd("say toggle""toggle")
 
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_knife""Fwd_PrimaryAttack"1)
    
RegisterHam(Ham_Item_Deploy"weapon_knife""Fwd_PrimaryAttack"1)
 
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_knife""Fwd_SecondaryAttack"1)
    
RegisterHam(Ham_Item_Deploy"weapon_knife""Fwd_SecondaryAttack"1)
}
 
public 
toggle(id)
        
blocked[id] = !blocked[id]
 
public 
Fwd_PrimaryAttack(Ent)
{
    new 
id get_pdata_cbase(Ent414)
 
    if (
blocked[id])
        
set_pdata_float(Ent479999.04)
 
    return 
HAM_IGNORED
}
 
public 
Fwd_SecondaryAttack(Ent)
{
    new 
id get_pdata_cbase(Ent414)
 
    if (!
blocked[id])
        
set_pdata_float(Ent469999.04)
 
    return 
HAM_IGNORED


Last edited by ~Ice*shOt; 03-29-2014 at 02:41.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
 



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 06:03.


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