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

Solved Deagle Quick Switch Plugin [REQ]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trickgod
Junior Member
Join Date: Jun 2018
Old 06-14-2018 , 13:13   Deagle Quick Switch Plugin [REQ]
Reply With Quote #1

Is it possible to quick switch automatically once a bullet is fired with Deagle?

Last edited by trickgod; 06-17-2018 at 08:18.
trickgod is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-14-2018 , 14:53   Re: Deagle Quick Switch Plugin [REQ]
Reply With Quote #2

not tested:
PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_Fire);
}

public 
Action Event_Fire(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
char sWeapon[32];
    
GetClientWeapon(iClientsWeapon32);
    
    if (!
StrEqual(sWeapon"weapon_deagle"))
        return 
Plugin_Handled;
    
    
ClientCommand(iClient"slot3");
    
    
CreateTimer(0.3Timer_DelayiClient);
    
    return 
Plugin_Handled;
}

public 
Action Timer_Delay(Handle hTimerint iClient)
{
    
ClientCommand(iClient"lastinv");

mug1wara is offline
trickgod
Junior Member
Join Date: Jun 2018
Old 06-14-2018 , 14:59   Re: Deagle Quick Switch Plugin [REQ]
Reply With Quote #3

Quote:
Originally Posted by mug1wara View Post
not tested:
PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_Fire);
}

public 
Action Event_Fire(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    
char sWeapon[32];
    
GetClientWeapon(iClientsWeapon32);
    
    if (!
StrEqual(sWeapon"weapon_deagle"))
        return 
Plugin_Handled;
    
    
ClientCommand(iClient"slot3");
    
    
CreateTimer(0.3Timer_DelayiClient);
    
    return 
Plugin_Handled;
}

public 
Action Timer_Delay(Handle hTimerint iClient)
{
    
ClientCommand(iClient"lastinv");

Work, Thanks
trickgod 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 09:15.


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