AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Default fire bullets for pistol (https://forums.alliedmods.net/showthread.php?t=307174)

Austin 04-29-2018 15:41

[L4D2] Default fire bullets for pistol
 
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;



Silvers 04-29-2018 16:31

Re: [L4D2] Default fire bullets for pistol
 
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.


All times are GMT -4. The time now is 09:31.

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