Raised This Month: $ Target: $400
 0% 

Help with my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ha1M
New Member
Join Date: Jul 2011
Old 08-08-2011 , 00:56   Help with my plugin
Reply With Quote #1

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.

Last edited by Ha1M; 08-08-2011 at 06:12.
Ha1M is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2011 , 01:07   Re: Help with my plugin
Reply With Quote #2

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.
__________________

Last edited by fysiks; 08-08-2011 at 01:10.
fysiks is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-08-2011 , 06:46   Re: Help with my plugin
Reply With Quote #3

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.
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
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 03:23.


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