Raised This Month: $ Target: $400
 0% 

al3x folder change, colorchat and delete adding stID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ekenn123
Junior Member
Join Date: Feb 2008
Old 01-04-2011 , 09:47   al3x folder change, colorchat and delete adding stID
Reply With Quote #1

Hello, I wonder if I can get a hand over here

This is the code :
PHP Code:
setBlockModelNameLarge(szBlockModelTarget[256], szBlockModelSource[256], size)
{
    
szBlockModelTarget szBlockModelSource;
    
replace(szBlockModelTargetsize".mdl""_large.mdl");
}

setBlockModelNameSmall(szBlockModelTarget[256], szBlockModelSource[256], size)
{
    
szBlockModelTarget szBlockModelSource;
    
replace(szBlockModelTargetsize".mdl""_small.mdl");
}

setBlockModelNamePole(szBlockModelTarget[256], szBlockModelSource[256], size)
{
    
szBlockModelTarget szBlockModelSource;
    
replace(szBlockModelTargetsize".mdl""_pole.mdl");

I wanna change it so the pole models are in "Pole" folder and small in "Small" folder etc. You got my point.

This is the location of the "normal blocks":
Quote:
new const g_model_Platform[] = "models/OutRun/Platform.mdl";
I'm using https://forums.alliedmods.net/showth...highlight=al3x .

So all credit to him

Thank you!

I also wonder if there is any possibility that someone could delete the saving part with:
PHP Code:
 #include <amxmodx>
 #include <amxmisc>

 #define TASK_GENERAL    100
 #define TASK_KICK    200

 
new name[32], authid[32], ip[32];

 new const 
rules[] = "rules.txt";
 new const 
agreedfile[] = "addons/amxmodx/configs/agreed.ini";
 new const 
declinedfile[] = "addons/amxmodx/configs/declined.ini";

 public 
plugin_init()
 {
    
register_plugin("Rules","0.20","DahVid/Avalanche");
    
register_menucmd(register_menuid("rules_menu"),1023,"RulesMenu");
    
register_clcmd("amx_removedecline","EraseDecline",ADMIN_BAN,"<authid> - removes an authid from decline list");
    
set_task(1.0,"checkforfiles");
 }

 public 
checkforfiles()
 {
    if(!
file_exists(agreedfile)) write_file(agreedfile,"; List of users that have agreed")
    if(!
file_exists(declinedfile)) write_file(declinedfile,"; List of users that have declined")
    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
    
}

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

        
parse(szLine,szData[0],31,szData[1],31,szData[2],31);
        if(
equali(szPAuthid,szData[0]))
        {
            
set_task(5.0,"DeclinedFunc",TASK_GENERAL+id);
            return; 
// user has declined
        
}
    }

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

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

 public 
EraseDecline(id,level,cid)
 {
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED;

    new 
szData[3][32], linek;

    static 
szPAuthid[32], szLine[256];
    
read_argv(1,szPAuthid,31);

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

        
parse(szLine,szData[0],31,szData[1],31,szData[2],31);
        if(
equali(szPAuthid,szData[0]))
        {
            
write_file(declinedfile,"",line-1);

            
console_print(id,"* Removed %s from the declined users list",szPAuthid);
            return 
PLUGIN_HANDLED;
        }
    }

    
console_print(id,"* Could not find %s in the declined users list",szPAuthid);
    return 
PLUGIN_HANDLED;
 }

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

    static 
szMenuBody[256];
    if(!
szMenuBody[0])
    {
        new 
len format(szMenuBody,255,"Rules:^n");
        
len += format(szMenuBody[len],255-len,"^n1. Agree");
        
len += format(szMenuBody[len],255-len,"^n2. Decline");
        
len += format(szMenuBody[len],255-len,"^n^n3. Show Rules");
    }

    new 
keys MENU_KEY_1|MENU_KEY_2|MENU_KEY_3;
    
show_menu(id,keys,szMenuBody,-1,"rules_menu");
 }

 public 
RulesMenu(id,key)
 {
    switch(
key
    {
        case 
0:
        {
            
get_user_name(id,name,31);
            
get_user_authid(id,authid,31);
            
get_user_ip(id,ip,31);

            
client_print(id,print_chat,"Thanks, have a fun time playing!",authid,ip,name);
            
            static 
agreed[256];
            
format(agreed,255,"%s %s %s",authid,ip,name);
            
write_file(agreedfile,agreed);
        }
        case 
1:
        {
            
get_user_name(id,name,31);
            
get_user_authid(id,authid,31);
            
get_user_ip(id,ip,31);

            
console_print(id,"Sorry, but we frown upon those who do not agree to our rules.",authid,ip,name);
            
            static 
declined[256];
            
format(declined,255,"%s %s %s",authid,ip,name);
            
write_file(declinedfile,declined);

            
server_cmd("kick #%i ^"You declined the rules!^"",get_user_userid(id));
        }
        case 
2:
        {
            
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);
        }
    }
 }

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

    
client_print(id,print_chat,"I'm sorry, but you have declined the rules. You have 60 seconds before you will be kicked.")
     
set_task(60.0,"KickUser",TASK_KICK+id);
 }

 public 
KickUser(taskid)
 {
    new 
id taskid-TASK_KICK;
    if(
is_user_connected(id)) server_cmd("kick #%i ^"You have previously declined the rules.^"",get_user_userid(id));
 } 
and
PHP Code:
 #include <amxmodx>
 #include <amxmisc>

 #define TASK_GENERAL    100
 #define TASK_KICK    200

 
new name[32], authid[32], ip[32];

 new const 
rules[] = "rules.txt";
 new const 
agreedfile[] = "addons/amxmodx/configs/agreed.ini";

 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(agreedfile)) write_file(agreedfile,"; List of users that have agreed")
    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,"Rules:^n");
        
len += format(szMenuBody[len],255-len,"^n1. Agree");
        
len += format(szMenuBody[len],255-len,"^n2. Decline");
        
len += format(szMenuBody[len],255-len,"^n^n3. Show Rules");
    }

    new 
keys MENU_KEY_1|MENU_KEY_2|MENU_KEY_3;
    
show_menu(id,keys,szMenuBody,-1,"rules_menu");
 }

 public 
RulesMenu(id,key)
 {
    switch(
key
    {
        case 
0:
        {
            
get_user_name(id,name,31);
            
get_user_authid(id,authid,31);
            
get_user_ip(id,ip,31);

            
client_print(id,print_chat,"Thanks, have a fun time playing!",authid,ip,name);
            
            static 
agreed[256];
            
format(agreed,255,"%s %s %s",authid,ip,name);
            
write_file(agreedfile,agreed);
        }
        case 
1:
        {
            
server_cmd("kick #%i ^"You declined the rules!^"",get_user_userid(id));
        }
        case 
2:
        {
            
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);
        }
    }
 } 
Cuz I want people to press agree EVERY time they enter the server!

And while I'm writing.. well.. why not a third thing?

How to make thing pop up in the chat thing, like info etc. "Don't forget to read our rules a 2nd time. Type /rules". With some colors. And how to make that /rules ? so it pop up like a HTML in the beginning?

I know it is a lot sorry, I'm not that great at scripting. But you gotta start somewhere right?

Thanks alot if someone could help me out!

Last edited by ekenn123; 01-04-2011 at 10:24. Reason: Had more to add
ekenn123 is offline
Reply


Thread Tools
Display Modes

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 02:07.


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