Raised This Month: $ Target: $400
 0% 

How would I create a /say command?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Steve
Junior Member
Join Date: Jul 2006
Old 07-02-2007 , 02:49   How would I create a /say command?
Reply With Quote #1

I want to make a say command that all users could do that then makes the server give them war3 experience. Any one?
__________________
Steve is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-02-2007 , 03:01   Re: How would I create a /say command?
Reply With Quote #2

Code:
#include <amxmodx> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "Drak" #define NUM_XP 50 new const say_command[] = "/something" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say","say_handle") } public say_handle(id) {     new text[512]     read_args(text,512)     remove_quotes(text)         if(equal(text,say_command))     {         new name[36]         get_user_name(id,name,36);                 server_cmd("w3_givexp ^"%s^" %i",name,NUM_XP)     } }
Change "/something" at the top to whatever you want.
I have no idea how you can give a person experience, since i never used warcraft or whatever. But i'm sure there's a server command for it, just let me know what it is.
__________________
Oh yeah

Last edited by Drak; 07-02-2007 at 03:13.
Drak is offline
Send a message via MSN to Drak
Steve
Junior Member
Join Date: Jul 2006
Old 07-02-2007 , 03:04   Re: How would I create a /say command?
Reply With Quote #3

Thanks man.


wc3_givexp username xp
__________________
Steve is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-02-2007 , 03:10   Re: How would I create a /say command?
Reply With Quote #4

Do you want the users to be able to define how much XP they get?
Or make it random?

Look above for the edited code, you can change "NUM_XP" to the amount the user gets.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2007 , 14:43   Re: How would I create a /say command?
Reply With Quote #5

I would suggest a simpler method:

Code:
#include <amxmodx>

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /lol", "handle_command")
}

public handle_command(id)
{
	//stuff...
}
stupok 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 21:35.


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