Raised This Month: $32 Target: $400
 8% 

Spy's Cause Fire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yoursavi0r
Junior Member
Join Date: Mar 2012
Old 03-25-2012 , 17:54   Spy's Cause Fire
Reply With Quote #1

Would someone give me a code that would cause spy revolvers to catch people on fire when they shoot them. I am working on a plugin that incorporates this.

I don't know if this applies, but is it possible to make it so that all spy revolvers, enforcer amby etc will do this?

Last edited by yoursavi0r; 03-25-2012 at 17:54.
yoursavi0r is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 03-25-2012 , 18:58   Re: Spy's Cause Fire
Reply With Quote #2

Hmm... this might work.
Attached Files
File Type: sp Get Plugin or Get Source (explosive_revolver.sp - 176 views - 857 Bytes)

Last edited by TheAvengers2; 03-25-2012 at 20:46. Reason: Updated attachment
TheAvengers2 is offline
yoursavi0r
Junior Member
Join Date: Mar 2012
Old 03-25-2012 , 20:14   Re: Spy's Cause Fire
Reply With Quote #3

I tested it out but this made me catch on fire, not the people I was shooting. Is there a way to fix that?
yoursavi0r is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 03-25-2012 , 20:18   Re: Spy's Cause Fire
Reply With Quote #4

PHP Code:
#include <tf2>
#define IS_CLIENT(%1)    (1 <= %1 <= MaxClients)

public Plugin:myinfo 
{
    
name "TF2 Explosive Revolver Rounds",
    
author "TheAvengers2",
    
description "Revolver rounds ignite victims",
    
version "1.0.0",
    
url "http://sourcemod.com/"
}

public 
OnPluginStart() {
    
HookEvent("player_hurt"Event_PlayerHurt);
}

public 
Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid")), attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
decl String:attackerWeapon[20];
    if (
IS_CLIENT(client) && IS_CLIENT(attacker) && IsClientInGame(attacker))
    {
        
GetClientWeapon(attackerattackerWeaponsizeof(attackerWeapon));
        if (
StrEqual(attackerWeapon"tf_weapon_revolver"))
        {
            
TF2_IgnitePlayer(client,attacker);
        }
    }

Should be fixed.

Last edited by necavi; 03-25-2012 at 20:37.
necavi is offline
yoursavi0r
Junior Member
Join Date: Mar 2012
Old 03-25-2012 , 20:19   Re: Spy's Cause Fire
Reply With Quote #5

Thank you a bunch for the help

EDIT: read below post

Last edited by yoursavi0r; 03-25-2012 at 20:25.
yoursavi0r is offline
yoursavi0r
Junior Member
Join Date: Mar 2012
Old 03-25-2012 , 20:24   Re: Spy's Cause Fire
Reply With Quote #6

Sorry but the same problem occurred, it still catches me on fire not the person I'm shooting.
yoursavi0r is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 03-25-2012 , 20:34   Re: Spy's Cause Fire
Reply With Quote #7

lol necavi, you failed to swap them.

here you go:

PHP Code:
#include <tf2>
#define IS_CLIENT(%1)    (1 <= %1 <= MaxClients)

public Plugin:myinfo 
{
    
name "TF2 Explosive Revolver Rounds",
    
author "TheAvengers2",
    
description "Revolver rounds ignite victims",
    
version "1.0.0",
    
url "http://sourcemod.com/"
}

public 
OnPluginStart() {
    
HookEvent("player_hurt"Event_PlayerHurt);
}

public 
Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid")), attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
decl String:attackerWeapon[20];
    if (
IS_CLIENT(client) && IS_CLIENT(attacker) && IsClientInGame(attacker))
    {
        
GetClientWeapon(attackerattackerWeaponsizeof(attackerWeapon));
        if (
StrEqual(attackerWeapon"tf_weapon_revolver"))
        {
            
TF2_IgnitePlayer(clientattacker);
        }
    }

Hmm.. I thought the first parameter was who initiated the action, unfortunately, it's actually the victim of it.
Attached Files
File Type: sp Get Plugin or Get Source (explosive_revolver.sp - 182 views - 857 Bytes)

Last edited by TheAvengers2; 03-25-2012 at 20:42.
TheAvengers2 is offline
yoursavi0r
Junior Member
Join Date: Mar 2012
Old 03-25-2012 , 20:43   Re: Spy's Cause Fire
Reply With Quote #8

It WORKS!!!! thanks a million
yoursavi0r 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 10:14.


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