Raised This Month: $ Target: $400
 0% 

[REQ] Acid Jarate


Post New Thread Reply   
 
Thread Tools Display Modes
Theme97
Senior Member
Join Date: Mar 2009
Old 06-14-2009 , 02:59   Re: [REQ] Acid Jarate
Reply With Quote #11

Quote:
Originally Posted by bl4nk View Post
Are you sure about this? I was using 'net_showevents 2' in my console and saw them fire just fine. I wouldn't have wrote the plugin if I didn't see them go off.
That's odd. I found this and I also added some debug output for the event but I never got anything.
Theme97 is offline
Wrath
Junior Member
Join Date: Jun 2009
Old 06-14-2009 , 21:47   Re: [REQ] Acid Jarate
Reply With Quote #12

Thanks for all the help
Wrath is offline
psychonic

BAFFLED
Join Date: May 2008
Old 06-14-2009 , 21:59   Re: [REQ] Acid Jarate
Reply With Quote #13

Quote:
Originally Posted by bl4nk View Post
Are you sure about this? I was using 'net_showevents 2' in my console and saw them fire just fine. I wouldn't have wrote the plugin if I didn't see them go off.
I have been curious about this too. It appears that it may be client-only. I just did a test with srcds and tf2 both open, with net_showevents 2 turned on on both. When jarateing, the event only showed in the client console.
psychonic is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 06-15-2009 , 00:26   Re: [REQ] Acid Jarate
Reply With Quote #14

I sent an email to the hlds mailing list about the events not firing server-side. Hopefully Valve will fix it in an upcoming update.
bl4nk is offline
Nightshde
Junior Member
Join Date: May 2009
Old 06-16-2009 , 15:52   Re: [REQ] Acid Jarate
Reply With Quote #15

is there a way to add the flinch effect like when they are on fire because right now unless u are looking at your health meter you dont notice that your taking damage.
Nightshde is offline
Wrath
Junior Member
Join Date: Jun 2009
Old 06-18-2009 , 22:48   Re: [REQ] Acid Jarate
Reply With Quote #16

Quote:
Originally Posted by Nightshde View Post
is there a way to add the flinch effect like when they are on fire because right now unless u are looking at your health meter you dont notice that your taking damage.
Oooh thats a interesting question
Wrath is offline
eXDee
Member
Join Date: May 2009
Old 12-08-2009 , 22:52   Re: [REQ] Acid Jarate
Reply With Quote #17

Quote:
Originally Posted by bl4nk View Post
I sent an email to the hlds mailing list about the events not firing server-side. Hopefully Valve will fix it in an upcoming update.
Thread bump, but was this fixed?
eXDee is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-08-2009 , 23:07   Re: [REQ] Acid Jarate
Reply With Quote #18

Quote:
Originally Posted by eXDee View Post
Thread bump, but was this fixed?
Yes and no.

The server event for it, listed in modevents.res, does not fire, but a similarly structured usermessage does.

Ex.

PHP Code:
public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("PlayerJarated"), Event_Jarated);
}

public 
Action:Event_Jarated(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
    new 
client BfReadByte(bf);
    new 
victim BfReadByte(bf);
    
    
// do something

    
return Plugin_Continue;

psychonic is offline
eXDee
Member
Join Date: May 2009
Old 01-16-2010 , 07:41   Re: [REQ] Acid Jarate
Reply With Quote #19

Sorry for another thread dig.

Ive tried editing the original script to have this coding in it, but it doesnt damage the player anymore. Any chance someone can quickly edit it hooking the usermessage to see who killed who?
eXDee is offline
eXDee
Member
Join Date: May 2009
Old 02-19-2010 , 00:55   Re: [REQ] Acid Jarate
Reply With Quote #20

Bump yet again.

Heres my attempt to combine bl4nks code with what psychonic gave as an example.
However im not sure where to use victim =/

PHP Code:
#pragma semicolon 1

#include <sourcemod>

new Handle:g_hTimerHandle[MAXPLAYERS+1];
new 
Handle:g_hCvarTime;
new 
Handle:g_hCvarDamage;

public 
Plugin:myinfo =
{
    
name "Acid Jarate",
    
author "bl4nk",
    
description "Players take damage while Jarated",
    
version "1.0.0",
    
url "http://forums.alliedmods.net"
};

public 
OnPluginStart()
{
    
g_hCvarTime CreateConVar("sm_acidjarate_time""3.0""Time inbetween each damage tick"FCVAR_PLUGINtrue0.1false_);
    
g_hCvarDamage CreateConVar("sm_acidjarate_damage""5""Damage to do per tick"FCVAR_PLUGINtrue1.0false_);

    
HookUserMessage(GetUserMessageId("PlayerJarated"), Event_PlayerJarated);
    
HookEvent("player_jarated_fade"Event_PlayerJaratedFade);
    
HookEvent("player_death"Event_PlayerDeath);
    
HookEvent("teamplay_round_start"Event_RoundStart);
}

public 
OnClientDisconnect(client)
{
    if (
g_hTimerHandle[client] != INVALID_HANDLE)
    {
        
KillTimer(g_hTimerHandle[client]);
        
g_hTimerHandle[client] = INVALID_HANDLE;
    }
}

public 
OnMapStart()
{
    for (new 
0<= MaxClientsi++)
    {
        
g_hTimerHandle[i] = INVALID_HANDLE;
    }
}

public 
Action:Event_PlayerJarated(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
    new 
client BfReadByte(bf);
    new 
victim BfReadByte(bf);

    
g_hTimerHandle[client] = CreateTimer(GetConVarFloat(g_hCvarTime), Timer_DamagePlayerclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);

    return 
Plugin_Continue;
}  

public 
Event_PlayerJaratedFade(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetEventInt(event"victim_index");

    
KillTimer(g_hTimerHandle[client]);
    
g_hTimerHandle[client] = INVALID_HANDLE;
}

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

    if (
g_hTimerHandle[client] != INVALID_HANDLE)
    {
        
KillTimer(g_hTimerHandle[client]);
        
g_hTimerHandle[client] = INVALID_HANDLE;
    }
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    for (new 
0<= MaxClientsi++)
    {
        if (
g_hTimerHandle[i] != INVALID_HANDLE)
        {
            
KillTimer(g_hTimerHandle[i]);
            
g_hTimerHandle[i] = INVALID_HANDLE;
        }
    }
}

public 
Action:Timer_DamagePlayer(Handle:timerany:client)
{
    new 
damage GetConVarInt(g_hCvarDamage);
    
SetEntProp(
        
client,
        
Prop_Send,
        
"m_iHealth",
        
GetEntProp(clientProp_Send"m_iHealth") - damage
    
);

eXDee 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 23:41.


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