Raised This Month: $51 Target: $400
 12% 

Event WeaponSwitch in L4D2?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TGMasterVN
Member
Join Date: May 2014
Location: Earth
Old 04-10-2016 , 05:04  
Reply With Quote #1

Hi, is there any event that will be called when players switch weapon in l4d2?

If not, can you help me to complete the code? I want to increase time when players switch from primary weapon to secondary weapon. So that can delay their fast melee trick

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_hurt",Event_PlayerHurtEventHookMode_Pre);
}

public 
Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    new 
client GetClientOfUserId(GetEventInt(event"userid"));

    
GetClientWeapon(attackerweaponnamesizeof(weaponname));

    if (
StrEqual(weaponname"weapon_melee"))
    {
        
// Some code that increase time switching weapon
    
}

Does anyone help?

Last edited by psychonic; 04-10-2016 at 09:53. Reason: merge doublepost
TGMasterVN is offline
sheo
SourceMod Donor
Join Date: Jul 2013
Location: Russia, Moscow
Old 04-11-2016 , 03:28   Re: Event WeaponSwitch in L4D2?
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=2407280
__________________
sheo is offline
TGMasterVN
Member
Join Date: May 2014
Location: Earth
Old 04-11-2016 , 20:03   Re: Event WeaponSwitch in L4D2?
Reply With Quote #3

Wow, i wish there is a thank button for you!
TGMasterVN 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 13:49.


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