AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect +attack2 Shield (https://forums.alliedmods.net/showthread.php?t=206613)

EpicMonkey 01-24-2013 11:54

Detect +attack2 Shield
 
Hello ... once again :3,

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.

ConnorMcLeod 01-24-2013 13:02

Re: Detect +attack2 Shield
 
Don't use CurWeapon, use Ham_CS_ResetMaxspeed.

EpicMonkey 01-24-2013 15:29

Re: Detect +attack2 Shield
 
Quote:

Originally Posted by ConnorMcLeod (Post 1879568)
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

Bos93 01-24-2013 16:53

Re: Detect +attack2 Shield
 
https://forums.alliedmods.net/showthread.php?t=205626

EpicMonkey 01-24-2013 17:06

Re: Detect +attack2 Shield
 
Quote:

Originally Posted by ConnorMcLeod (Post 1879568)
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 :3

Quote:

Originally Posted by Bos93 (Post 1879768)

was about to post the solution :3

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 :3


All times are GMT -4. The time now is 20:40.

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