Raised This Month: $ Target: $400
 0% 

problem while handling a say command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-18-2009 , 21:45   Re: problem while handling a say command
Reply With Quote #1

You could use just IF

PHP Code:
public hookSay(id)
{
    static 
msg[192]
 
    
read_args(msg191)
    
remove_quotes(msg)
    
trim(msg)
 
    if(
equali(msgSVPASS_CMDSVPASS_LEN))
    {
        
copy(msg191msg[SVPASS_LEN+1])
        
server_cmd("sv_password ^"%s^""msg)
        
client_print(0print_chat"(test) Server password changed to: %s"msg)
 
        return 
PLUGIN_HANDLED
    
}
 
    if(
equali(msg".hostname"9))
    {
        
copy(msg191msg[9])
        
server_cmd("hostname ^"%s^""msg)
 
        return 
PLUGIN_HANDLED
    
}
 
    return 
PLUGIN_CONTINUE

Anyway, another method I do not know, search through plugins that does this thing you want and see their methods
__________________
Hunter-Digital is offline
Cader
Senior Member
Join Date: Mar 2007
Old 05-18-2009 , 22:06   Re: problem while handling a say command
Reply With Quote #2

thank you anyway, is it possible to use more than one register to "say" command? like ;

public plugin_init()
{
register_clcmd("say", "SVPass")
register_clcmd("say", "HostName")
}
Cader is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-18-2009 , 22:32   Re: problem while handling a say command
Reply With Quote #3

Yes (I think, try it and find out). Also, I don't see why your first code won't work.
__________________
fysiks is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-18-2009 , 23:56   Re: problem while handling a say command
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Also, I don't see why your first code won't work.
it's because you can't retrieve any other arguments from the say command, except for all arguments together like Hunter-Digital did, and then you need to separate each word.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-19-2009 , 19:27   Re: problem while handling a say command
Reply With Quote #5

Quote:
Originally Posted by Dores View Post
it's because you can't retrieve any other arguments from the say command, except for all arguments together like Hunter-Digital did, and then you need to separate each word.
Oh, I get it now . Thanks for the explaination.
__________________
fysiks is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-19-2009 , 23:57   Re: problem while handling a say command
Reply With Quote #6

lol, sorry, but i don't really know why it's like that, i just know it is.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 01:31.


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