AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   read_argv i think. (https://forums.alliedmods.net/showthread.php?t=11976)

stigma 04-02-2005 06:31

read_argv i think.
 
How can i get the second word to be posted in a hud message? like if you write in normal say: say Hello - The the server would post 'You said: Hello'

v3x 04-02-2005 13:08

Something like this..
Code:
#include <amxmodx> public plugin_init() {     // ..     register_clcmd("say","handle_say")     register_clcmd("say_team","handle_say") } public handle_say(id) {     new message[298]     read_args(message,297)     remove_quotes(message)     if(containi(message,"hello")) {         client_print(id,print_chat,"You said hello!")     }     return PLUGIN_CONTINUE }
Edited*

Twilight Suzuka 04-02-2005 18:48

With say messages, you have to either read all the args with read+agrs, then remove quotes, or use read_argv(1, and hope that no one uses binds *it doesnt pick up binds*

v3x 04-02-2005 21:29

Gotcha. ;)


All times are GMT -4. The time now is 09:56.

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