Raised This Month: $ Target: $400
 0% 

Chat argv's look inside.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-05-2010 , 06:51   Chat argv's look inside.
Reply With Quote #1

Ello there, i've got this problem:
When i try to get TWO arguments for ex:

PHP Code:
public plugin_init() {
...
     
register_clcmd("say""c_say");
     
register_clcmd("say_team""c_say");
}

public 
c_say(id) {
     new 
arg1[100];
     
readv_args(1arg1sizeof(arg1) - 1);

     
client_print(0print_chat"[TAG] %s"arg1);

     if(
contain(arg1"/settopic") != -1) {
          new 
arg2[50];
          
readv_args(2arg2sizeof(arg2) - 1);

          
client_print(0print_chat"[TAG] Topic set to: %s"arg2);
     }

It successfully gets what i type and outputs to [TAG] Text...
But if i say /settopic and it just dont get the second arg, so how to do it?
Do i have to get the second argument at very start?

EDIT: Tried putting reading arg2 on top - doesn't work.

Last edited by Lure.d; 03-05-2010 at 07:00.
Lure.d is offline
Send a message via Skype™ to Lure.d
 



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 08:42.


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