Raised This Month: $32 Target: $400
 8% 

Detect +attack2 Shield


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 01-24-2013 , 11:54   Detect +attack2 Shield
Reply With Quote #1

Hello ... once again ,

I would like to know if there is a way to detect when +attack2 is used with a shield , i mean when the shield is covering the player.
What am doing is: am setting a players speed using cur weapon , but the problem is when he uses +attack2 while holding a shield his speed gets reset.
Any links [Even though i've already searched] or help will be deeply appreciated.

Last edited by EpicMonkey; 01-24-2013 at 11:55.
EpicMonkey is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-24-2013 , 13:02   Re: Detect +attack2 Shield
Reply With Quote #2

Don't use CurWeapon, use Ham_CS_ResetMaxspeed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 01-24-2013 , 15:29   Re: Detect +attack2 Shield
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Don't use CurWeapon, use Ham_CS_ResetMaxspeed.
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "None"

new g_Test[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /test""Test")
    
RegisterHam(Ham_CS_Player_ResetMaxSpeed"player""Fw_MaxSpeed")
}

public 
Test(id)
{
    
g_Test[id] = true
}

public 
Fw_MaxSpeed(id)
{
    if(
g_Test[id])
    {
        
set_user_maxspeed(id400.0)
    }

The function calls , ive debugged it and eveything , it all works ... but speed doesnt change
EpicMonkey is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-24-2013 , 16:53   Re: Detect +attack2 Shield
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=205626
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 01-24-2013 , 17:06   Re: Detect +attack2 Shield
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Don't use CurWeapon, use Ham_CS_ResetMaxspeed.
Thank you , works like a charm ... better than curweapon in my situation obv , cant believe i never came across this function

Quote:
Originally Posted by Bos93 View Post
was about to post the solution

well since you already did ... then i dont need to

(Was kinda stupid what i did up there ... went to bed and realized that i made a stupid and silly mistake

Last edited by EpicMonkey; 01-24-2013 at 17:12.
EpicMonkey 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 00:29.


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