Raised This Month: $ Target: $400
 0% 

Help: Custom Stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-12-2012 , 21:56   Help: Custom Stats
Reply With Quote #1

Performance? Any suggestions??

Ps.
I will be done the plugin with a SQLx later.

And help for saving method:

On new round + client disconnect

or

On round end + client disconnect..

I will appreciate any help
Attached Files
File Type: sma Get Plugin or Get Source (stats.sma - 529 views - 2.8 KB)
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-13-2012 at 17:57.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-13-2012 , 06:27   Re: Help: Custom Stats
Reply With Quote #2

PHP Code:

for(new i;iNum;i++)
{
     
Players iPlayers[i];
     new 
CsTeams:iTeam cs_get_user_team(Players); 
You should create the variable outside the loop.

Last edited by Backstabnoob; 06-13-2012 at 06:28.
Backstabnoob is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-13-2012 , 07:35   Re: Help: Custom Stats
Reply With Quote #3

PHP Code:
 switch(Place)
 {
  case 
HIT_GENERICStatsData[Attacker][_Hit_Generic] += 1;
  
  case 
HIT_HEADStatsData[Attacker][_Hit_Head] += 1;
  
  case 
HIT_CHESTStatsData[Attacker][_Hit_Chest] += 1;
  
  case 
HIT_STOMACHStatsData[Attacker][_Hit_Stomach] += 1;
  
  case 
HIT_LEFTARMStatsData[Attacker][_Hit_Left_Arm] += 1;
  
  case 
HIT_RIGHTARMStatsData[Attacker][_Hit_Right_Arm] += 1;
  
  case 
HIT_LEFTLEGStatsData[Attacker][_Hit_Left_Leg] += 1;
  
  case 
HIT_RIGHTLEGStatsData[Attacker][_Hit_Right_Leg] += 1;
 } 
-->

PHP Code:
StatsData[Attacker][Place 7] += 1
__________________
<VeCo> is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-13-2012 , 10:13   Re: Help: Custom Stats
Reply With Quote #4

k+ thanks

round end or new round?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-13-2012 , 10:35   Re: Help: Custom Stats
Reply With Quote #5

It's up to you, it doesn't matter.
Backstabnoob is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-13-2012 , 15:57   Re: Help: Custom Stats
Reply With Quote #6

PHP Code:
            switch(cs_get_user_team(Players))
            {
                case 
CS_TEAM_T:
                {
                    
StatsData[Players][_Rounds_Played]++;
                    
                    
StatsData[Players][_Round_Wins]++;
                }
                case 
CS_TEAM_CT:
                {
                    
StatsData[Players][_Rounds_Played]++;
                    
                    
StatsData[Players][_Rounds_Loses]++;
                }
            } 
Sorry, small fix
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-13-2012 at 15:58.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-13-2012 , 16:06   Re: Help: Custom Stats
Reply With Quote #7

PHP Code:
public bomb_planting(id)
{
    if(!
get_pcvar_num(p_Active)) return;
    
    
StatsData[id][_Bomb_Planting] += 1;

also

PHP Code:
public bomb_defusing(id)
{
    if(!
get_pcvar_num(p_Active)) return;
    
    
StatsData[id][_Bomb_Defusing] += 1;

Add repeating protect, i saw many players that press the +USE button several times before beggining the actual defuse process.

Or you may add a cooldown, IE. don't count if it is pushed more than once in a second or so.
DjOptimuS is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-13-2012 , 16:29   Re: Help: Custom Stats
Reply With Quote #8

Incorrect: Only counts when a progress bar its open.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-13-2012 , 16:44   Re: Help: Custom Stats
Reply With Quote #9

yes i know, but he can push the +USE button till the progress bar appears, and then he can -USE (cancel the action) and after that +USE again

it's the same thing
DjOptimuS is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-13-2012 , 17:56   Re: Help: Custom Stats
Reply With Quote #10

Updated code witch CSW and HIT Constants.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 06:16.


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