Raised This Month: $ Target: $400
 0% 

is it possible to unregisted +attack ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-15-2011 , 20:27   Re: is it possible to unregisted +attack ?
Reply With Quote #2

+attack is a client side command not a server one, the client sends a flag to the server which can be read using:
Code:
if(get_user_buttons(id) & IN_ATTACK)
{
    // player "id" is holding attack button
}
Still, if you want to block weapons from firing, you can set their next attack delay to something huge and you can then reset it using a commmand.

Using Ham_Weapon_PrimaryAttack you can hook weapon primary attack, it will give you the weapon entity (NOT CSW_* constants, entity) and you can use that to set it's next attack using set_pdata_float() on the entity with 46 as offset (47 for secondary attack) and the delay added... use something like 99999.0 and store the entity name in a array for that player (preferably indexed CSW_ id)
You could also make a global bool or something to determine if it's before or after the "fight" command but it would save alot of calls just by unregistering ham events when not needed.

Then on your "fight" command just loop through all players getting their weapons and using referenced array to get entity id and use that set_pdata_float() again, this time set it to 0.0
__________________
Hunter-Digital is offline
 



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 23:28.


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