Raised This Month: $ Target: $400
 0% 

read_argv i think.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stigma
Senior Member
Join Date: Mar 2005
Location: Denmark
Old 04-02-2005 , 06:31   read_argv i think.
Reply With Quote #1

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'
stigma is offline
Send a message via MSN to stigma Send a message via Skype™ to stigma
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-02-2005 , 13:08  
Reply With Quote #2

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*
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-02-2005 , 18:48  
Reply With Quote #3

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*
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-02-2005 , 21:29  
Reply With Quote #4

Gotcha. ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 09:56.


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