AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How would I create a /say command? (https://forums.alliedmods.net/showthread.php?t=57302)

Steve 07-02-2007 02:49

How would I create a /say command?
 
I want to make a say command that all users could do that then makes the server give them war3 experience. Any one?

Drak 07-02-2007 03:01

Re: How would I create a /say command?
 
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.

Steve 07-02-2007 03:04

Re: How would I create a /say command?
 
Thanks man.


wc3_givexp username xp

Drak 07-02-2007 03:10

Re: How would I create a /say command?
 
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.

stupok 07-03-2007 14:43

Re: How would I create a /say command?
 
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...
}



All times are GMT -4. The time now is 21:34.

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