server_cmd is a function in amxmdx.inc
const szCommand[] is the main parameter (its the command you want to execute inputted as a string)
, any . . . means you're able to put in variables to the previous string.
for example.....
Code:
server_cmd("amx_gravity %d", iGravityToSet)
That's going to take a little bit of experience to do. Its not a simple "Hello World" app. But here's a real simple way of doing it. (not exactly what you want, because i'm lazy and don't want to give you all the answers)
PHP Code:
#include <amxmodx>
#define PLUGIN "Echo"
#define VERSION "1.0"
#define AUTHOR "Liverwiz"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say", "handleSay") // hook say command to handleSay (say is chat in game -default 'y')
}
public handleSay(id)
{
new szInput[192] // 192 is maxlen of text in chat (factoid for you)
read_args(szInput, charsmax(szInput) ) // this grabs what the player said
remove_quotes(szInput) // remove quotes so it doesn't get messy
new szOutput[200], szName[32] // initialize all variables we're going to use
get_user_name(id, szName, charsmax(szName) )
// This puts the name and input into one string
// preping to print....
formatex(szOutput, charsmax(szOutput), "%s said: %s", szName, szInput)
client_print(0, print_chat, szOutput)
return PLUGIN_CONTINUE
}
You should note that the formatex, and consequently szOutput are not required. You can put that directly into the client_print. I only put it there as an example if you were going to go the "SayText" message route, you'll have to use that method.
I wrote a plugin that does soemthing of this nature (plus lots of other crap) its called Private Message. You'll find it in new plugin submissions. It'll give you an example of grabbing text, minipulating it, and printing it using SayText messages
__________________