Raised This Month: $ Target: $400
 0% 

Player is using weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-06-2010 , 20:26   Player is using weapon
Reply With Quote #1

Is there a way to detect if player is using a weapon?
I know about user_has_weapon but it checks if player have the weapon not if he is using it at the moment.
I need this to reset user maxspeed after a speed boost given by set_user_maxspeed(id, 500.0).
If I just set it to 230 (m4a1 and most of primary weapons maxspeed) you will have to switch weapons to get the default weapon maxspeed.
So im wondering if its possible to check if user is using a certain weapon and set the weapon maxspeed to him.
__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-06-2010 , 20:31   Re: Player is using weapon
Reply With Quote #2

Put this at the to of plugin :

const Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame


And when you want to restore player maxspeed do :

ExecuteHamB(Ham_Player_ResetMaxSpeed, id)

The game will check what is the player active weapon and set speed back.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 03-07-2010 , 03:15   Re: Player is using weapon
Reply With Quote #3

@ConnorMcLeod what diference:
PHP Code:
RegisterHamHam_Item_PreFrame"player""fw_PlayerReset_MaxSpeed_Post"
and
PHP Code:
const Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
RegisterHam
Ham_Player_ResetMaxSpeed"player",  "fw_PlayerReset_MaxSpeed_Post"
?
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-07-2010 , 04:30   Re: Player is using weapon
Reply With Quote #4

Readability.
Explaination on the tip is there : http://forums.alliedmods.net/showthr...469#post846469
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 08:40.


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