handle_say and read_argv Problem~
Code:
public plugin_init() {it's show "[AMXX] helo" right i'm tried it's work if type "say !test helo" in console can't work if press Y to type "!test helo" how can fix it? |
Re: handle_say and read_argv Problem~
I have no idea what you're trying to do with those argument # readings
PHP Code:
|
Re: handle_say and read_argv Problem~
Quote:
|
Re: handle_say and read_argv Problem~
I really don't understand what you mean either...
PHP Code:
|
Re: handle_say and read_argv Problem~
_Master_'s code attempts to do what was asked. Yours does not.
Code:
|
Re: handle_say and read_argv Problem~
I would go with _Master_ 's solution. :up:
|
Re: handle_say and read_argv Problem~
Why did you delete your code? There wasn't much wrong with your approach and as I said before, I don't think _Master_'s will actually work.
Anyway.. Code:
|
Re: handle_say and read_argv Problem~
Quote:
i want to do this : command: !test [username] [message] if(equali(arg, "!test ", 6)) i can get username now.. how can i get the [message] only? |
Re: handle_say and read_argv Problem~
[OFF-TOPIC]
@ LEE: "%s" implies that the argumet be treated as array and will copy the content of that array beginning with the first element supplied and ending it when it reads '/0'. So instead of using "arg" as a way to get all the text you could use arg[0] as well because strings are always passed by reference. Having said that, arg[6] is a sub-text of arg[0] which starts at position 6 in the array. If we use anything else than "%s" then it's treated as a SINGLE element and then your statement is correct. [/OFF-TOPIC] @ lucky109: If we get inside this if(equali(arg, "!test ", 6)) then arg[6] will hold the text said. A more elaborate way for this: PHP Code:
say "this won't show anything because it's missing !test" say "!test this would show" <- will print "[AMXX] this would show" say "!testthis would show also" <- will print "[AMXX] this would show also" say "!test_______________________________________ _______will show too" <- will print "[AMXX] will show too" |
| All times are GMT -4. The time now is 21:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.