Raised This Month: $ Target: $400
 0% 

concmd problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pRED*
Join Date: Dec 2006
Old 02-14-2007 , 18:29   concmd problems
Reply With Quote #1

Hey I'm having a problem with a say command.

Ive got this in my plugin_init()

PHP Code:
register_clcmd("say /whois""cmd_whois"0"<target> "
and then later on in the code...

PHP Code:
public cmd_whois(idlevelcid)
{
         if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED
 
        
new Arg1[24]
    new 
Arg2[24]

    
         
read_argv(2Arg223)
 
         
        new 
player cmd_target(idArg21)
        
    if (!
player)
        {
  
            
console_print(id"Sorry, player %s could not be found or targetted!"Arg1)
            return 
PLUGIN_HANDLED
        
}
    else
    {
        new 
name[18];
            
get_user_name(player,name,17);

        new 
motd[2048],tempstring[2048];

        
add(motd,2048,"<html><strong><b>");
        
format(tempstring,2048,"Rank and Badge Stats for Player %s </strong></b>"name)
        
add(motd,2048,tempstring);
        
add(motd,2048,"<br><br>");
        
format(tempstring,2048,"Players Rank: %s",RANKS[g_PlayerRank[player]])
        
add(motd,2048,tempstring);
        
add(motd,2048,"<br>");
        
add(motd,2048,"Current Badges Owned: <br>");

        for (new 
counter=0counter<MAX_BADGEScounter++)
        {
            if(
g_PlayerBadges[player][counter]!=0)
            {
                
format(tempstring,2048,"&nbsp;-%s<br>",BADGES[counter][g_PlayerBadges[player][counter]])
                
add(motd,2048,tempstring);
            }
        }
        
        
add(motd,2048,"</html>");

        
show_motd(id,motd,"Player Info")
        
        }
        
         return 
PLUGIN_HANDLED

It works fine if I type "say /whois name" directly into the console but if I try do it as normal say "/whois name" it just prints to the screen and doesn't execute the function at all.

Any help would be appreciated.

Thanks
pRED* is offline
 



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 00:41.


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