Raised This Month: $ Target: $400
 0% 

Terms & Agreement (With Client Logging)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 01-31-2009 , 21:08   Terms & Agreement (With Client Logging)
Reply With Quote #1

I have good plugin with Terms & Agreements but this show rules only once.
Ill be apreciated if someone can modify sma and delete proper part with this file agreed.ini
What i need is the same plugin but every time when you connect plugin show this menu - Agree, Decline and Show Rules.
Thanks if someone get might few minutes and help.

Here is more info about this.
http://forums.alliedmods.net/showthread.php?p=444215
Attached Files
File Type: sma Get Plugin or Get Source (agree_nodeclined.sma - 640 views - 2.4 KB)
Mifuntm is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-31-2009 , 21:42   Re: Terms & Agreement (With Client Logging)
Reply With Quote #2

PHP Code:
 #include <amxmodx>
 #include <amxmisc>

 #define TASK_GENERAL    100
 #define TASK_KICK    200

 
new const rules[] = "rules.txt";

 public 
plugin_init()
 {
    
register_plugin("Terms and Agreements","0.20","DahVid/Avalanche");
    
register_menucmd(register_menuid("rules_menu"),1023,"RulesMenu");
    
set_task(1.0,"checkforfiles");
 }

 public 
checkforfiles()
 {
    if(!
file_exists(rules)) write_file(rules,"Erase this line and add your rules here. HTML can be used.")
 }

 public 
client_putinserver(id)
 {
    
remove_task(TASK_GENERAL+id);
    
remove_task(TASK_KICK+id);

    if(
is_user_bot(id)) return;

    new 
szData[3][32], linek;

    static 
szPAuthid[32], szLine[256];
    
get_user_authid(id,szPAuthid,31);

    while((
line read_file(agreedfile,line,szLine,255,k)) != 0)
    {
        if(
szLine[0] == ';' || !k) continue;

        
parse(szLine,szData[0],31,szData[1],31,szData[2],31);
        if(
equal(szPAuthid,szData[0])) return; // user has agreed before
    
}

    
set_task(5.0,"DisplayRulesMenu",TASK_GENERAL+id);
 }

 public 
client_disconnect(id)
 {
    
remove_task(TASK_GENERAL+id);
    
remove_task(TASK_KICK+id);
 }

 public 
DisplayRulesMenu(taskid)
 {
    new 
id taskid-TASK_GENERAL;

    static 
szMenuBody[256];
    if(!
szMenuBody[0])
    {
        new 
len format(szMenuBody,255,"Terms and Agreements:^n");
        
len += format(szMenuBody[len],255-len,"^n7. Agree");
        
len += format(szMenuBody[len],255-len,"^n8. Decline");
        
len += format(szMenuBody[len],255-len,"^n^n9. Show Rules");
    }

    new 
keys MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;
    
show_menu(id,keys,szMenuBody,-1,"rules_menu");
 }

 public 
RulesMenu(id,key)
 {
    switch(
key
    {
        case 
6:
        {
            
client_print(id,print_chat,"* Thanks, have a fun time playing!");
        }
        case 
7:
        {
            
server_cmd("kick #%i ^"You declined the rules!^"",get_user_userid(id));
        }
        case 
8:
        {
            
client_print(id,print_chat,"* Please read the rules more diligently to risk being banned!");

            
show_motd(id,rules,"SERVER RULES");
            
set_task(5.0,"DisplayRulesMenu",TASK_GENERAL+id);
        }
    }
 } 
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Mifuntm
Senior Member
Join Date: Feb 2008
Location: in space...
Old 02-01-2009 , 08:19   Re: Terms & Agreement (With Client Logging)
Reply With Quote #3

found resolution with help of my friend.
Now plugin work fine, and i give sma for other members AlliedModders if they needed.
Plugin show rules menu every time someone connect to the server. You can choose betwen Agree, Decline and Show Rules.
In /cstrike directory make file rules.txt and write your own rules (HTLM Supported)

BTW. Exolent[jNr] thanks for try to help
Attached Files
File Type: sma Get Plugin or Get Source (agree_nodeclined.sma - 583 views - 1.8 KB)

Last edited by Mifuntm; 02-01-2009 at 10:44. Reason: Found plugin work correct
Mifuntm 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 01:37.


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