PHP Code:
#include <amxmodx>
#define PLUGIN "Rules Agreement"
#define VERSION "1.0"
#define AUTHOR "GameFreak"
#define MOTD "addons/amxmodx/configs/adminrules.txt"
#define MOTD2 "addons/amxmodx/configs/normalrules.txt"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("agreemenu.txt");
register_clcmd( "rules_menu","client_putinserver");
}
public client_putinserver(id) {
new szMenuName[32];
formatex(szMenuName, 31, "\r%L:", id, "MENU_HEADER");
new menu = menu_create(szMenuName, "menu_handler");
new Temp[32];
formatex(Temp, 31, "%L", id, "AGREE");
menu_additem(menu, Temp, "1", 0);
formatex(Temp, 31, "%L^n^n", id, "DECLINE");
menu_additem(menu, Temp, "2", 0);
formatex(Temp, 31, "\y%L", id, "RULES");
menu_additem(menu, Temp, "3", ADMIN_ADMIN);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item) {
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
client_print(id, print_chat, "[Surf Mod] %L", id, "THANKS");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 2:
{
server_cmd("kick #%i ^"You declined the rules!^"",get_user_userid(id));
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 3:
{
new szMotdName[32];
if(get_user_flags(id) && ADMIN_MENU) {
formatex(szMotdName, 31, "%L", id, "MENU_HEADER");
show_motd(id, MOTD, szMotdName);
}
else {
formatex(szMotdName, 31, "%L", id, "MENU_HEADER");
show_motd(id, MOTD2, szMotdName);
}
client_putinserver(id);
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
Well, i want this to show when a player joins the server...