Raised This Month: $ Target: $400
 0% 

Terms & Agreements


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-27-2009 , 11:42   Terms & Agreements
Reply With Quote #1

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(PLUGINVERSIONAUTHOR);
   
   
register_dictionary("agreemenu.txt");
   
   
register_clcmd"rules_menu","client_putinserver");
}

public 
client_putinserver(id) {
   new 
szMenuName[32];
   
formatex(szMenuName31"\r%L:"id"MENU_HEADER");
   new 
menu menu_create(szMenuName"menu_handler");

   new 
Temp[32];
   
formatex(Temp31"%L"id"AGREE");
   
menu_additem(menuTemp"1"0);
   
formatex(Temp31"%L^n^n"id"DECLINE");
   
menu_additem(menuTemp"2"0);
   
formatex(Temp31"\y%L"id"RULES");
   
menu_additem(menuTemp"3"ADMIN_ADMIN);

   
menu_setprop(menuMPROP_EXITMEXIT_ALL);

   
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem) {
   if( 
item == MENU_EXIT )
   {
       
menu_destroy(menu);

       return 
PLUGIN_HANDLED;
   }

   new 
data[6], iName[64];
   new 
accesscallback;

   
menu_item_getinfo(menuitemaccessdata,5iName63callback);

   new 
key str_to_num(data);

   switch(
key)
   {
       case 
1:
       {
           
client_print(idprint_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(szMotdName31"%L"id"MENU_HEADER");
             
show_motd(idMOTDszMotdName);
      }
      else {
      
formatex(szMotdName31"%L"id"MENU_HEADER");
      
show_motd(idMOTD2szMotdName);
      }
      
client_putinserver(id);
       }
   }

   
menu_destroy(menu);
   return 
PLUGIN_HANDLED;

Well, i want this to show when a player joins the server...

I tried client_connect, but it didn't work.
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-27-2009 , 11:47   Re: Terms & Agreements
Reply With Quote #2

Try setting a task for like 5 seconds after client_putinserver().
__________________
hleV is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-27-2009 , 11:50   Re: Terms & Agreements
Reply With Quote #3

Hook Ham_Spawn, for "player", and put there, it will be best way
__________________
xPaw is offline
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 15:16.


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