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

Domination and revenge in HL2 Deathmatch


Post New Thread Reply   
 
Thread Tools Display Modes
OhHai
Junior Member
Join Date: Aug 2019
Old 03-08-2020 , 08:18   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #11

Quote:
Originally Posted by Ilusion9 View Post
Try this:

PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma newdecls required

int g_ConsecutiveKills[MAXPLAYERS 1][MAXPLAYERS 1];

public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
}

public 
void OnClientConnected(int client)
{
    for (
int i 1MAXPLAYERS 1i++)
    {
        
g_ConsecutiveKills[client][i] = 0;
        
g_ConsecutiveKills[i][client] = 0;
    }
}

public 
void Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid"));    
    if (!
victim)
    {
        return;
    }
    
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    if (!
attacker || attacker == victim)
    {
        return;
    }

    
bool revenge g_ConsecutiveKills[victim][attacker] > 3;
    
g_ConsecutiveKills[attacker][victim]++
    
g_ConsecutiveKills[victim][attacker] = 0;
    
    if (
revenge)
    {
        
PrintToChat(attacker"You revenged on %N!"victim);
        
PrintToChat(victim"%N has revenged on you!"attacker);
        return;
    }
    
    
int consKills g_ConsecutiveKills[attacker][victim];
    if (
consKills == 4)
    {
        
PrintToChat(victim"%N is dominating you."attacker);
        
PrintToChat(attacker"You are now dominating %N."victim);
        return;
    }
    
    if (
consKills 4)
    {
        
PrintToChat(victim"%N is still dominating you."attacker);
        
PrintToChat(attacker"You are still dominating %N."victim);
    }

It seems there's no warmup in hl2dm.
Quote:
Originally Posted by Ilusion9 View Post
The plugin is working well.
OhHai is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-08-2020 , 09:31   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #12

Was working well for csgo.
__________________
Ilusion9 is offline
VSG
Member
Join Date: May 2019
Location: Spain
Old 03-08-2020 , 10:59   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #13

Hey, it's working now after the corrections!

I am going to customize myself slightly the chat texts now, like putting caps on domination & revenge words, maybe try to to change players colors...but this is it.

I'll put you on my donations list & will advertise this as your work on the clan forum. Big thanks.
VSG is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-08-2020 , 11:08   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #14

Quote:
Originally Posted by VSG View Post
Hey, it's working now after the corrections!

I am going to customize myself slightly the chat texts now, like putting caps on domination & revenge words, maybe try to to change players colors...but this is it.

I'll put you on my donations list & will advertise this as your work on the clan forum. Big thanks.
I will put translations and colors for translations and release it as a plugin. Maybe I will add a setting to play sounds on revenge, dominations. Also, I will add a cvar: after how many kills there's a domination.
__________________
Ilusion9 is offline
VSG
Member
Join Date: May 2019
Location: Spain
Old 03-08-2020 , 15:46   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #15

I can do the spanish translations if you wish. I also believe it is more correct in english, to say "You took revenge on x" and "x has taken revenge on you" than your options, or at least they are more common.

Let me know when you need the spanish parts, send a pm.

Cheers!
VSG is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-08-2020 , 17:23   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #16

Try this one.
Attached Files
File Type: sp Get Plugin or Get Source (dominations_revenges.sp - 46 views - 2.4 KB)
File Type: txt dominations_revenges.phrases.txt (801 Bytes, 48 views)
File Type: inc colorlib_sample.inc (4.5 KB, 37 views)
__________________
Ilusion9 is offline
VSG
Member
Join Date: May 2019
Location: Spain
Old 03-09-2020 , 04:21   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #17

This new version does not create output text on the chat for me.

The straight plugin you are attaching loads on the server as you made it with no errors, but no info is shown.

Then I tried compiling it for my SM 1.8 version, get the following error:

Quote:
dominations_revenges.sp(83): warning 203 : symbol is never used: "CtranslateColor"
Compiled doing this:
-dominations_revenges.sp on scripting folder
-colorlib_sample.inc on scripting/include folder
-dominations_revenges.phrases.txt on configs folder?

It could be that I missed some step during compilation. Anyway, this compiled version also does not work.

Last edited by VSG; 03-09-2020 at 04:25.
VSG is offline
VSG
Member
Join Date: May 2019
Location: Spain
Old 03-09-2020 , 04:34   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #18

Oh, I also have this frequently on console output:

Quote:
L 03/09/2020 - 091:49: [SM] Exception reported: Language phrase "You Took Revenge" not found
L 03/09/2020 - 091:49: [SM] Blaming: dominations_revenges.smx
L 03/09/2020 - 091:49: [SM] Call stack trace:
L 03/09/2020 - 091:49: [SM] [0] PrintToChat
L 03/09/2020 - 091:49: [SM] [1] Line 59, dominations_revenges.sp::Event_PlayerDeath
So I'm trying with putting file "dominations_revenges.phrases.txt" on the cfg/sourcemod folder now.

Last edited by VSG; 03-09-2020 at 04:41.
VSG is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-09-2020 , 06:10   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #19

Add dominations_revenges.phrases.txt in translations folder.
colorlib_sample.inc in include folder from scripting folder.
__________________
Ilusion9 is offline
VSG
Member
Join Date: May 2019
Location: Spain
Old 03-09-2020 , 06:59   Re: Domination and revenge in HL2 Deathmatch
Reply With Quote #20

Ok, now I get this:

{lime} You are now Dominating Noriko.

or

{orange} Al has taken Revenge on you.

I'm pretty sure all files are now in their proper places. I read some doc pages about chat colors, and they state these colors are not handled the same way on Source 2009 games and later Source games, there are some differences. So maybe colors work good with your plugin on csgo.
VSG 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 13:16.


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