Raised This Month: $51 Target: $400
 12% 

Chat Messages...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
liOVERLOADil
Junior Member
Join Date: Jul 2004
Old 08-03-2004 , 01:17   Chat Messages...
Reply With Quote #1

I'm making a new plugin and I have come to a brick wall.

I wan't to be able to initiate a command via chat and have the plugin
copy what comes after the command and be able to reproduce it later,
slightly modified.

For example, someone types the following in chat: "/plugin I am stupid"

I wan't the plugin to get what was typed in chat, and cull the "/plugin " part
so all I will be left with is; "I am stupid".

I'm also having trouble figuring out how to get the plugin to start when you
have more than "/plugin" in chat.
__________________
liOVERLOADil is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 08-03-2004 , 15:26  
Reply With Quote #2

register_clcmd("say /plugin"...
Then use read_args
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 08-03-2004 , 15:35  
Reply With Quote #3

I'll type up a quick example
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {  register_plugin("Test say example","1.0","SnipaJ")  register_clcmd("say /plugin","sayfunc", ADMIN_CHAT," : <message> Displays message in HUD") } public sayfunc() {  new message[200]  read_argv(1,message,200)  set_hudmessage(255,255,255,1.0,0.35,0,1.0,12.0,1,1,1)  show_hudmessage(0,message) }
thats an example on how to use it from what devicenull said (i was bored so i typed it up) correct me if im wrong devicenull...
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 08-03-2004 , 15:36  
Reply With Quote #4

That should work, except you probably need a space between #include and <amxmisc>
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 08-03-2004 , 15:37  
Reply With Quote #5

yea i already fixed that
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
liOVERLOADil
Junior Member
Join Date: Jul 2004
Old 08-04-2004 , 01:01  
Reply With Quote #6

Thanks Guys!
__________________
liOVERLOADil 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:04.


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