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_iUserPlants[ 33 ]
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_iUserPlants[ id ]++
g_iTotalPlants++
}
public ClientCommand_User_Times( id )
{
client_print( id, print_chat, "You have planted the bomb %d times!", g_iUserPlants[ id ] )
}
public ClientCommand_Total_Times( id )
{
client_print( id, print_chat, "The bomb has been planted %d times!", g_iTotalPlants )
}
get_loguser_index()
{
new loguser[80], name[32]
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
return get_user_index(name)
}
Should I decrease loguser from 80 to 32 or what's the best num for it, thanks in advance.