This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

HELP with stats and FFA


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
A in Chains
Junior Member
Join Date: Mar 2014
Old 03-03-2014 , 05:31   HELP with stats and FFA
Reply With Quote #1

Hi, this is my first topic here.

I have a server using csdm with FFA, and i blocked the terrorist team, so al the players playing are CT's.
I have a problem with rank, the new players (with stats all in 0) are showed in first place, and the better players are at the bottom.

So I think that the problem comes from the native get_user_stats, but by the other hand when csdm ffa is on, the score showed it's ok. And when you see the stats from the rank, the kills aren't in negative numbers..

Somebody can giveme some tips?
A in Chains is offline
A in Chains
Junior Member
Join Date: Mar 2014
Old 03-03-2014 , 18:09   Re: HELP with stats and FFA
Reply With Quote #2

This was the most easy solution that i could find, but then i don't know what to do to modify top15


Code:
public cmdRank(id)
{
	if (!SayRank)
	{
		client_print(id, print_chat, "%L", id, "DISABLED_MSG")
		return PLUGIN_HANDLED
	}

	new izStats[8], izBody[8]
	new iRankPos, iRankMax
	new Float:fEff, Float:fAcc
	
	iRankPos = get_user_stats(id, izStats, izBody)
	iRankMax = get_statsnum()
	new TestingPos = (iRankMax - iRankPos) + 1
	
	fEff = effec(izStats)
	fAcc = accuracy(izStats)
	
	client_print(id, print_chat, "* %L", id, "YOUR_RANK_IS", TestingPos, iRankMax, izStats[STATS_KILLS], izStats[STATS_HITS], fEff, fAcc)
	
	return PLUGIN_CONTINUE
}

But now the problem is that when 2 players have the same frags, the better is showed last.
John = 1 dead 1 kill 100eff
Paul = 1 dead 1 kill 50eff

Paul rank showed with my script is 1, and john 2.



It is possible that stats arent showed in negative numbers, but are counted like negative?? because what i'm thinking is that i could multiply frags * 2 and make it positive, somebody can tell me how i can multply frags?

Last edited by A in Chains; 03-03-2014 at 19:43. Reason: Forget +1, mistake
A in Chains is offline
A in Chains
Junior Member
Join Date: Mar 2014
Old 03-04-2014 , 11:01   Re: HELP with stats and FFA
Reply With Quote #3

Well I Find how to change the order, and how to change the numers # from position.

PHP Code:
format_top15(sBuffer[MAX_BUFFER_LENGTH 1])
{
    new 
iMax get_statsnum()
    
    new 
izStats[8], izBody[8]
    new 
iLen 0
    
new iRTop iMax 16
    
    
        

    
new lKills[16], lDeaths[16], lHits[16], lShots[16], lEff[16], lAcc[16]
    
    
format(lKills15"%L"LANG_SERVER"KILLS")
    
format(lDeaths15"%L"LANG_SERVER"DEATHS")
    
format(lHits15"%L"LANG_SERVER"HITS")
    
format(lShots15"%L"LANG_SERVER"SHOTS")
    
format(lEff15"%L"LANG_SERVER"EFF")
    
format(lAcc15"%L"LANG_SERVER"ACC")
    
    
ucfirst(lEff)
    
    
ucfirst(lAcc)

    
iLen format(sBufferMAX_BUFFER_LENGTH"<body bgcolor=#000000><font color=#FFB000><pre>")
    
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"%2s %-22.22s %6s %6s %6s %6s %4s %4s %4s^n""#""Nick"lKillslDeathslHitslShots"HS"lEfflAcc)
    
    for (new 
iMax 1iRTop && MAX_BUFFER_LENGTH iLen 0i--)
    {
        
get_stats(iizStatsizBodyt_sNameMAX_NAME_LENGTH)
        
replace_all(t_sNameMAX_NAME_LENGTH"<""[")
        
replace_all(t_sNameMAX_NAME_LENGTH">""]")
        
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n"iMax it_sNameizStats[STATS_KILLS], 
                        
izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
    }

Now I need to change the sort of order, I attached an image to see the problem, between 1st and 2nd place you can notice the mistake
Attached Thumbnails
Click image for larger version

Name:	HalfLife57.jpg
Views:	244
Size:	39.8 KB
ID:	131124  

Last edited by A in Chains; 03-04-2014 at 11:08. Reason: my mistake
A in Chains is offline
A in Chains
Junior Member
Join Date: Mar 2014
Old 03-04-2014 , 11:48   Re: HELP with stats and FFA
Reply With Quote #4

Well I tested and i find that the problem is that the frags showed are negative numbers, but the eff and acc showed aren't counting that.
So i need to multipy frags * frags but, the question is where does i need to multiply frags? because if i'm not confused the statsx only takes data and print it

PLEEASEE HEELP

EDIT:
I opened csstats.dat with WINCSX and i find something really strange.. from there i could see the rank how it should be, but when i saved.. the ranks is showed like if i didn't edited anything

Last edited by A in Chains; 03-04-2014 at 12:16. Reason: Review
A in Chains is offline
A in Chains
Junior Member
Join Date: Mar 2014
Old 03-05-2014 , 08:48   Re: HELP with stats and FFA
Reply With Quote #5

yeeeeeaahh
Finally I solved the problem.
The thing is that the stats is differencing if frags are teamkills or enemy kills. Thats why fraga arent in negative numbers, i could check this from the WINCSX becaise there i saw the field teamkills, and it was equal the same as frags field (because in my server u can be only ct) so the statsx was taking as null the frags from players.
One thing that seems to be really bad from the statsx is that u cant se yours teamkills, but they are being counting...


My solution was to multiply teamkills*0 from csstats.amxx


I think that people with ffa servers have to know this thing, because i could notice that just because i blocked the terrorist team... but if ur server is ffa and people can join both teams, maybe, u couldnt notice that if u kill player from ur team, that frags were not countinting..

Sorry about my english and hope that other people like me, now can fix this problem reading my post

Last edited by A in Chains; 03-05-2014 at 20:15. Reason: mistake
A in Chains 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 15:53.


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