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

SoD Player Stats


Post New Thread Reply   
 
Thread Tools Display Modes
IHQ-ReimaDWMH]
Junior Member
Join Date: Jul 2006
Old 04-02-2008 , 14:12   Re: SoD Player Stats
Reply With Quote #91

Quote:
Originally Posted by FrostbyteX View Post
Have you checked the thread about enabling support for text menus? It's in the plugin description.

Also, can you send me the modinfo.res (is this right?) file so that I can look at the mod's events?

Steve
I tried the enabling, but when I for example type sm_admin to the console I get a very small gray box to the area where there should be the text based menu.

I send you some files that I looked into. Maybe they can help.
__________________
IHQ-ReimaDWMH] is offline
Fenrix
Member
Join Date: Mar 2008
Old 04-02-2008 , 23:28   Re: SoD Player Stats
Reply With Quote #92

hmmm, I know this one might be tricky but could you build in a function to export the current ranks to a text file sorted by rank?
it would be easier for my style of ranking than the current way
as it is I reset the ranks each month and add the top 10 to a championship type ladder where each player is given reverse rank points

eg: rank 1 gets 10pts rank 2 gets 9, that kind of thing.

its easier than typing top and writing down the names in notepad
(this is mainly because I have not got any kind of web server access to my scores for outputting them)
Fenrix is offline
FrostbyteX
Senior Member
Join Date: Dec 2007
Old 04-03-2008 , 10:01   Re: SoD Player Stats
Reply With Quote #93

Fenrix, would dumping top10 to console work?
FrostbyteX is offline
IHQ-ReimaDWMH]
Junior Member
Join Date: Jul 2006
Old 04-05-2008 , 19:51   Re: SoD Player Stats
Reply With Quote #94

I got the stats working in deathmatch mode for the Ballmen mod:



Thanks in advance!

Edit: Took the code off to shorten this thread.
__________________

Last edited by IHQ-ReimaDWMH]; 04-07-2008 at 13:20.
IHQ-ReimaDWMH] is offline
Fenrix
Member
Join Date: Mar 2008
Old 04-06-2008 , 05:42   Re: SoD Player Stats
Reply With Quote #95

dumping to console would work.
whatever works that allows some simple text output of the ranks
Fenrix is offline
IHQ-ReimaDWMH]
Junior Member
Join Date: Jul 2006
Old 04-07-2008 , 13:05   Re: SoD Player Stats
Reply With Quote #96

Now the ballmen.sp is working in every gamemode! Thanks alot for help to bl4nk!

Code:
// File:   ballmen.sp

#define ID_BALLMEN 715517

HookEventsBallmen()
{
	HookEvent("player_death", Event_BallmenDeath);
}

public Event_BallmenDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	// Read relevant event data
	new userid   = GetClientOfUserId(GetEventInt(event, "userid"));
	new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	
	if(g_initialized[attacker] && 
	   g_initialized[userid])
	{
		new user_team = GetClientTeam(userid);
		new attacker_team = GetClientTeam(attacker);
		new Handle:hndl_gameMode = FindConVar("mp_gamemode");
		new gameMode = GetConVarInt(hndl_gameMode);
		
		// Check for suicide
		if(userid == attacker)
		{
			g_deaths[userid]++;
			g_session_deaths[userid]++;
		}
		// Otherwise it's a legitimate kill!
		else if(userid != attacker && gameMode == 0)
		{
			g_kills[attacker]++;
			g_deaths[userid]++;
			
			g_session_kills[attacker]++;
			g_session_deaths[userid]++;
			
			new score_dif = g_score[userid] - g_score[attacker];
			if(score_dif < 0)
				score_dif = 2;
			else
				score_dif = 2 + (g_score[userid] - g_score[attacker])/100;

			
			g_score[attacker] += score_dif + 1;
			g_session_score[attacker] += score_dif + 1;
			
			g_score[userid] -= score_dif;
			g_session_score[userid] -= score_dif;
			
			SavePlayer(attacker);
			SavePlayer(userid);
		}
		else if(user_team != attacker_team && gameMode == 1 || user_team != attacker_team && gameMode == 2)
		{
			g_kills[attacker]++;
			g_deaths[userid]++;
			
			g_session_kills[attacker]++;
			g_session_deaths[userid]++;
			
			new score_dif = g_score[userid] - g_score[attacker];
			if(score_dif < 0)
				score_dif = 2;
			else
				score_dif = 2 + (g_score[userid] - g_score[attacker])/100;

			
			g_score[attacker] += score_dif + 1;
			g_session_score[attacker] += score_dif + 1;
			
			g_score[userid] -= score_dif;
			g_session_score[userid] -= score_dif;
			
			SavePlayer(attacker);
			SavePlayer(userid);
		}
	}
}
__________________
IHQ-ReimaDWMH] is offline
IHQ-ReimaDWMH]
Junior Member
Join Date: Jul 2006
Old 04-07-2008 , 13:18   Re: SoD Player Stats
Reply With Quote #97

Quote:
Originally Posted by FrostbyteX View Post
Fenrix, would dumping top10 to console work?
I have to use the 'esc' -menus. When I dump the top10 to console, I get only top3...like I have 3 buttons in 'esc' -menu. How I fix this?
__________________
IHQ-ReimaDWMH] is offline
FrostbyteX
Senior Member
Join Date: Dec 2007
Old 04-07-2008 , 21:53   Re: SoD Player Stats
Reply With Quote #98

Quote:
Originally Posted by IHQ-ReimaDWMH] View Post
I have to use the 'esc' -menus. When I dump the top10 to console, I get only top3...like I have 3 buttons in 'esc' -menu. How I fix this?
Since you've already modified the code a bit, just replace the DrawMenuText calls with DrawMenuItem.
FrostbyteX is offline
PStar
Veteran Member
Join Date: Mar 2008
Old 04-22-2008 , 05:20   Re: SoD Player Stats
Reply With Quote #99

Where does it stores the players stats?
PStar is offline
FrostbyteX
Senior Member
Join Date: Dec 2007
Old 04-23-2008 , 11:44   Re: SoD Player Stats
Reply With Quote #100

Quote:
Originally Posted by PStar View Post
Where does it stores the players stats?
In the "storage-local" SQLite database.
FrostbyteX 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 11:44.


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