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

edit statsx.sma


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bello2
Senior Member
Join Date: Jun 2010
Location: Venezuela
Old 08-16-2010 , 19:55   edit statsx.sma
Reply With Quote #1

hello guys! This time i want to help me to edit the statsx in this way:

I want the command:

PHP Code:
register_clcmd("say /stats""cmdStats"0"- display players stats (menu/MOTD)"
Works for 2 things:

1.Which brings by default, which is to show the menu with the players on the server

2.This is where i want to help me, what i achieve is that the command work in this way:

say /stats "name"

Where the word "name", is the name of the player which you are going to see their stats

The problem is that i have not succeeded in doing so, do it here:

PHP Code:
// Player stats menu.
public cmdStats(id)
{
    if (!
SayStatsAll)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}
    
    
showStatsMenu(idg_izUserMenuPosition[id] = 0)

    return 
PLUGIN_CONTINUE

You try this way and not worked:

PHP Code:
// Player stats menu.
public cmdStats(id)
{
    if (!
SayStatsAll)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}
    
    
showStatsMenu(idg_izUserMenuPosition[id] = 0)

    new 
arg[32]
    
read_args(arg31)
    
remove_quotes(arg)
    
    new 
player cmd_target(idargCMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF)
    
    
format_stats(idg_sBuffer)
    
get_user_name(playert_sNameMAX_NAME_LENGTH)
    
show_motd(idg_sBuffert_sName)
    

    return 
PLUGIN_CONTINUE

Bello2 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2010 , 01:09   Re: edit statsx.sma
Reply With Quote #2

To add arguments into a say command is not something that will be easy for you, FYI. Find a plugin that uses arguements in a say command and do it that way. (You will have to handle all "say" commands).
__________________
fysiks is offline
Bello2
Senior Member
Join Date: Jun 2010
Location: Venezuela
Old 08-25-2010 , 19:42   Re: edit statsx.sma
Reply With Quote #3

some help? I have tried to do so with various forms and i have not achieved.
Bello2 is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-25-2010 , 19:45   Re: edit statsx.sma
Reply With Quote #4

you have to just register say and read the command and parse it.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Bello2
Senior Member
Join Date: Jun 2010
Location: Venezuela
Old 08-25-2010 , 20:52   Re: edit statsx.sma
Reply With Quote #5

Quote:
Originally Posted by nikhilgupta345 View Post
you have to just register say and read the command and parse it.
LOL -.-" I want is for the same command serve for 2 things.

1. .stats // Is it that makes at the moment
2. .stats "name" // Is what you specify up in the first post
Bello2 is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-25-2010 , 20:57   Re: edit statsx.sma
Reply With Quote #6

I no.. but you cannot get the second parameter "name" without reading all of say and hooking all say's

so you'd have to do this:

Code:
register_clcmd("say", "hook_say")
register_clcmd("say_team", "hook_say")
read the say, and check if it either equals /stats or contains /stats and go froom there.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Bello2
Senior Member
Join Date: Jun 2010
Location: Venezuela
Old 08-25-2010 , 21:42   Re: edit statsx.sma
Reply With Quote #7

Quote:
Originally Posted by nikhilgupta345 View Post
I no.. but you cannot get the second parameter "name" without reading all of say and hooking all say's

so you'd have to do this:

Code:
register_clcmd("say", "hook_say")
register_clcmd("say_team", "hook_say")
read the say, and check if it either equals /stats or contains /stats and go froom there.
Since you understand, you can leave an example more descriptive?
Bello2 is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 08-25-2010 , 22:35   Re: edit statsx.sma
Reply With Quote #8

Quote:
Originally Posted by Bello2 View Post
Since you understand, you can leave an example more descriptive?
Or you can try something first and come back with your attempt.
__________________
Hi.
Kreation 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 13:08.


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