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

Team win logger


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-10-2008 , 15:18   Team win logger
Reply With Quote #1

Hello, my server have HLstatsX ranking and want to configurate that the ranking is based on round wins and not on kill/deaths because campers get high ranked then.

My idea is to give the winning team one point and take one point away from the losing team then everyone have a fair chance to get into the top10.

HLstatsX have the feature to give every player from the winning team points by the info that the server send. The below line outside the server log file is the info that HLstatsX get to give the players of the winning round some points.

Team "CT" triggered "CTs_Win" (CT "9") (T "7")

CTs_win
can only be usedones and to take away some points of the losing team i need a 2nd CTs_win line only then for example CTs_win2.

Now my request if somebody can make or tell me how i can make a plugin that add a line in the server log file each time after one of the below lines are writed in the server log file.
Team "CT" triggered "CTs_Win" (CT "9") (T "7") and
Team "TERRORIST" triggered "Terrorists_Win" (CT "13") (T "9")

For example:
Team "CT" triggered "CTs_Win" (CT "9") (T "7")
Team "CT" triggered "CTs_Win2" (CT "9") (T "7")
Team "TERRORIST" triggered "Terrorists_Win" (CT "13") (T "9")
Team "TERRORIST" triggered "Terrorists_Win2" (CT "13") (T "9")

Thanks for reading and i hope someone can help me.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-10-2008 , 16:34   Re: Team win logger
Reply With Quote #2

The only thing i can think of or actualy copied from other plugins is the below mentioned script.
Code:
#include <amxmodx>

    register_plugin("Round Win Logging", "", "")
    register_event("CTs_Win", "Event_CTs_Win", "a")
    register_event("Terrorists_Win", "Event_Terrorists_Win", "a")

public Event_CTs_Win(id)
    {
    log_message(Team "CT" triggered "CTs_Win2")
    }

public Event_Terrorists_Win(id)
    {
    log_message(Team "TERRORISTS" triggered "Terrorists_Win2")
    }
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-10-2008 , 18:05   Re: Team win logger
Reply With Quote #3

Well, i'm not sure of exactly what you want to send, and this would require some tests, so, test this :
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-11-2008 at 13:17.
ConnorMcLeod is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-11-2008 , 12:45   Re: Team win logger
Reply With Quote #4

Thanks for the plugin connor! But unfortunely i see no new logged win event. I don't know if it is possible to detect the CTs_Win event and that the plugin just would make a logline like Team "CT" triggered "CTs_Win".

So that it would look like this.

L 02/11/2008 - 15:08:48: "palyer1<6021><STEAM_0:1:1234><CT>" killed "player2<5988><STEAM_0:1:1111><TERRORIST> " with "m4a1"
L 02/11/2008 - 15:08:48: Team "CT" triggered "CTs_Win" (CT "20") (T "12")
L 02/11/2008 - 15:08:48: Team "CT" triggered "CTs_Win2"
L 02/11/2008 - 15:08:48: World triggered "Round_End"
L 02/11/2008 - 15:08:54: World triggered "Round_Start"

The score isn't needed in the seccond win event and in the above case the (CT "20") (T "12") part.

The below 4 mentioned events decide wich team wins and if it would be possible i like to duplicate all 4 events in the server log only adding a 2 behind the event name, e.g. CTs_Win would be CTs_Win2.

All_Hostages_Rescued
CTs_Win
Hostages_Not_Rescued
Terrorists_Win

Here a screenshot from the point bonus system of HLstatsX wich maybe say alot more as all my writed words.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 02-11-2008 at 13:04.
Maurice is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-11-2008 , 12:55   Re: Team win logger
Reply With Quote #5

Then, this should work (i'll test) :

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Team Win Logger""0.1b""connorr")
    
register_logevent("Team_Win"6"0=Team")
}

public 
Team_Win()
{
    static 
szTeam[10], szTeam2[10]

    
read_logargv(1szTeam9)


    if(
szTeam[0] == 'T')
    {
        
formatex(szTeam29"Terrorist")
    }
    else
    {
        
copy(szTeam29szTeam)
    }

    
log_message("Team ^"%s^" triggered ^"%ss_Win2^""szTeamszTeam2)

-edit-

Works fine (code edited again):

Code:
L 02/11/2008 - 19:08:43: Team "TERRORIST" triggered "Terrorists_Win2"
L 02/11/2008 - 19:08:43: Team "TERRORIST" triggered "Terrorists_Win" (CT "0") (T "1")
L 02/11/2008 - 19:08:43: World triggered "Round_End"

L 02/11/2008 - 19:10:35: Team "CT" triggered "CTs_Win2"
L 02/11/2008 - 19:10:35: Team "CT" triggered "Bomb_Defused" (CT "1") (T "0")
L 02/11/2008 - 19:10:35: World triggered "Round_End"
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-11-2008 at 13:20.
ConnorMcLeod is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-11-2008 , 15:06   Re: Team win logger
Reply With Quote #6

This one works flawlessly Connorr! Thanks, you are really becomming a force i can't be without because i'm not only use plugins you maded but you helped me alot of times already with custum plugins/problems!
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice 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 16:56.


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