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

[Solved] Getting the planted / defused stats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-16-2012 , 02:14   [Solved] Getting the planted / defused stats
Reply With Quote #1

Hello,

How can I get the planted or defused stats ( planted / defused times ) of certain user ? If I use global variable which I increase on the planted / defused events, it will return the total times... ?

I figured it out how, but I have one question:

PHP Code:
#include <amxmodx>

new g_iUserPlants33 ]
new 
g_iTotalPlants 0

public plugin_init()
{
    
register_plugin"Test""1.0""Tonev" )
    
    
register_logevent"Event_Bomb_Planted"3"2=Planted_The_Bomb" )
    
    
register_clcmd"say /userplants""ClientCommand_User_Times" )
    
register_clcmd"say /totalplants""ClientCommand_Total_Times" )
}

public 
Event_Bomb_Planted()
{
    new 
id get_loguser_index()
    
g_iUserPlantsid ]++
    
    
g_iTotalPlants++
}

public 
ClientCommand_User_Timesid )
{
    
client_printidprint_chat"You have planted the bomb %d times!"g_iUserPlantsid ] )
}

public 
ClientCommand_Total_Timesid )
{
    
client_printidprint_chat"The bomb has been planted %d times!"g_iTotalPlants )
}
    
get_loguser_index() 
{
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)
 
    return 
get_user_index(name)

Should I decrease loguser from 80 to 32 or what's the best num for it, thanks in advance.

Last edited by dark_style; 08-16-2012 at 02:33.
dark_style is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2012 , 02:39   Re: [Solved] Getting the planted / defused stats
Reply With Quote #2

use csx module and get_user_?stats, that module already stores what you need.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-16-2012 , 02:48   Re: [Solved] Getting the planted / defused stats
Reply With Quote #3

Thanks, I will take a look at it.

Last edited by dark_style; 08-16-2012 at 02:51.
dark_style 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 12:10.


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