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

[L4D2] Default fire bullets for pistol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 04-29-2018 , 15:41   [L4D2] Default fire bullets for pistol
Reply With Quote #1

I have the following plugin I wrote for css/csgo to make the glock shoot fire bullets.
It works fine in css/csgo.

I would like to have this for L4D2 pistols.
I modified the weapon name to match the pistol in L4D2,
but it doesn't work.

What do I have to do so the l4d2 pistol "ignites" the common and special infected?
tx

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo =
{
    
name "ABSUtils",
    
author "Austinbots",
    
description "L4D2 Default Fire Bullets for Pistol",
    
version "1.0",
    
url ""
}

public 
OnPluginStart()
{
}

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_TraceAttackHookTraceAttack);
}

public 
Action:HookTraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotypehitboxHitGroup)
{
    
decl String:weapon[100];

    if (!
attacker || attacker MaxClients)
        return 
Plugin_Continue;

    
GetClientWeapon(attackerweapon100);
    if(
strcmp(weapon"weapon_pistol") == 0)
    {
        
IgniteEntity(victim,10.0);
        
PrintToChatAll("\x04 %s!",weapon);
    }

    return 
Plugin_Continue;


Last edited by Austin; 04-29-2018 at 15:42.
Austin is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-29-2018 , 16:31   Re: [L4D2] Default fire bullets for pistol
Reply With Quote #2

Well that should work, but here:

PHP Code:
    entity CreateEntityByName("point_hurt");
    
Format(sTempsizeof(sTemp), "ext%d%d"entityclient);
    
DispatchKeyValue(target"targetname"sTemp);
    
DispatchKeyValue(entity"DamageTarget"sTemp);
    
DispatchKeyValue(entity"DamageType""8");
    
DispatchSpawn(entity);
    
AcceptEntityInput(entity"Hurt"client);
    
RemoveEdict(entity); 
As much as I hate RemoveEdict, I actually seem to use this for "hurt" entities, such as "point_hurt" and this fire etc. But maybe it's time to replace all RemoveEdict() with AcceptEntityInput(entity, "Kill"); which is much safer.

Anyway, for examples on igniting common/special see Mutant Zombies or Molotov Shove, Extinguisher and Mini Gun Flamethrower have too. The damagetype is 8 for fire.
__________________

Last edited by Silvers; 04-29-2018 at 16:31. Reason: typo
Silvers 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 14:29.


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