AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with my plugin (https://forums.alliedmods.net/showthread.php?t=164159)

Ha1M 08-08-2011 00:56

Help with my plugin
 
Hello :)
i try to create plugin
this is my first plugin
this is the code :
PHP Code:

#include <amxmodx>

#define PLUGIN "map"
#define VERSION "0.1"
#define AUTHOR "_Ha1M_/Wait"


public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd"say /map""MAP" )
register_clcmd"say !map""MAP" )
}

public 
MAP(id)
{
if ( !(
get_user_flags(id)&ADMIN_CVAR))
return 
PLUGIN_CONTINUE;
server_cmd("changelevel %s")
client_print0print_chat"Map change to %s");
return 
PLUGIN_HANDLED;


when i write "!map" or "!map de_dust2"
Nothing happens.
what can i do?
and sorry for my english,
Thanks, Haim.

fysiks 08-08-2011 01:07

Re: Help with my plugin
 
Unfortunately, you cannot register say commands with arguments. You have to register everything that goes through the say command and manually parse it to get command and the argument. You should consider using (or viewing if you want to know how it's done) the smart slash plugin.

Also, there are several topics in this section about getting arguments for say/chat commands.

deadman909 08-08-2011 06:46

Re: Help with my plugin
 
Just add this plugin to your server.
http://forums.alliedmods.net/showthread.php?p=611167

After you added your /map command well work with the original amx_map command.


All times are GMT -4. The time now is 03:23.

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