Raised This Month: $ Target: $400
 0% 

Issue with command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-05-2010 , 20:33   Issue with command
Reply With Quote #1

Hey, so basically what this command is supposed to do is get the kills and wins of the person after the command. .stats <target>

However, whenever I type .stats RedRobster it doesn't show anything. But if I type .stats by itself, it shows my stats. Aswell as whenever anyone else types .stats it shows my stats, not theirs.

PHP Code:
public plugin_init()
{
    
//...Other Cvars, Commands, etc.
    
register_clcmd("say .stats","show_stats",ADMIN_ALL,"<target>"//Registers reg. chat command
    
register_clcmd("say_team .stats","show_stats",ADMIN_ALL"<target>"//Registers team chat command

PHP Code:
public show_stats(id)
{    
    new 
Arg2[24//Where <target> will be stored
    
    
read_argv(2,Arg2,23//Reads <target> and stores as Arg2
        
    
new player cmd_target(id,Arg2,0//Gets ID of command target stored as "player"
    
new playername[25//Where the target name will be stored
            
    
if(!player//If target "player" doesn't exist
    
{
        
client_print_color(id,DontChange,"^3%s ^1could not be found.",Arg2//Target doesn't exist
        
return PLUGIN_HANDLED
    
}
    else
    {
        
get_user_name(player,playername,24//Gets full name of target
    
        
client_print_color(id,DontChange,"^3%s ^1has ^3%i Kills ^1and ^3%i Wins.",playername,PlayerKills[player],PlayerWins[player])
    }
    return 
PLUGIN_HANDLED

RedRobster is offline
 


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 05:17.


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