Raised This Month: $ Target: $400
 0% 

Requst Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mohanad_2022
Member
Join Date: Jan 2022
Location: Palestine
Old 01-27-2022 , 16:22   Requst Plugin
Reply With Quote #1

Hello guys , hope all are well !

i want requst plugin called "Admin login system"
it work like when user get admin he will join the server noramlly without type "setinfo _pw" on console
but befor he choose team or join the macth he will get black screen and have on topleft "Type_password :" and if the user did not type the password correctly on 30 sec [OR] he typed it 3 times mistakly he will get kick

i have the amxx file of the plugin which i need and i did decompile by lysis for it , so i hope these codes help u to make the sma file of the plugin and ready to compile without errors .

here the decompiled amxx code :

PHP Code:
new String:g_szFile[64] = "login_users.ini";
new 
Trie:g_tDatabase;
new 
g_SzAuth[33][2][34];
new 
g_password[33][32];
new 
g_Acces[33];
new 
g_prefix[33][32];
new 
g_shouldlogin[33];
new 
g_timer[33];
get_configsdir(name[], len)
{
    return 
get_localinfo("amxx_configsdir"namelen);
}

public 
plugin_init()
{
    
register_plugin("Admin Login""1.6""[email protected]");
    
register_message(get_user_msgid("VGUIMenu"), "VGUIMenu");
    
register_message(get_user_msgid("MOTD"), "message_MOTD");
    
register_clcmd("jointeam""HookTeamCommands", -118956, -1);
    
register_clcmd("chooseteam""HookTeamCommands", -118956, -1);
    
register_clcmd("ENTER_PASSWORD""cmd_admin_pass", -118956, -1);
    
register_clcmd("say test""cmd_admin_test", -118956, -1);
    
Load_Users();
    return 
0;
}

Load_Users()
{
    new 
configsDir[64];
    
get_configsdir(configsDir63);
    
formatex(configsDir"""%s/%s"configsDirg_szFile);
    new 
File fopen(configsDir"rt");
    if (
File)
    {
        
g_tDatabase TrieCreate();
        new 
Pdata[512];
        new 
aData[130];
        while (!
feof(File))
        {
            
fgets(FilePdata511);
            
trim(Pdata);
            new 
var1;
            if (!(
Pdata[0] == 59 || Pdata[0] == 47 || Pdata[0] == 92 || !Pdata[0] || Pdata[0]))
            {
                if (!(
parse(PdataaData33aData[34], 31aData[66], 31aData[98], 31)))
                {
                    
server_print("file data: %s, %s, %s, %s, %d"aDataaData[34], aData[66], aData[98], 130);
                    
TrieSetArray(g_tDatabaseaDataaData130);
                    
arrayset(aData"amxx_configsdir"130);
                }
            }
        }
        
fclose(File);
    }
    else
    {
        
set_fail_state("Couldn't load admins file");
    }
    return 
0;
}

public 
plugin_end()
{
    
TrieDestroy(g_tDatabase);
    return 
0;
}

public 
client_disconnected(id)
{
    
remove_task(id 849"amxx_configsdir");
    
g_shouldlogin[id] = 0;
    
g_password[id][0] = 0;
    
g_Acces[id] = 0;
    
g_prefix[id][0] = 0;
    return 
0;
}

public 
Task_Login_(taskid)
{
    new 
id taskid + -849;
    new 
var1 g_timer[id];
    
var1--;
    if (!
var1)
    {
        
server_cmd("kick #%d \"Sorry you where kicker for not entering the password\""get_user_userid(id));
    }
    
client_print(id4"You Have %d Second(s) To Login !"g_timer[id]);
    
remove_task(id"amxx_configsdir");
    return 
0;
}

public 
cmd_admin_pass(id)
{
    if (
g_shouldlogin[id])
    {
        static 
SzArgs[32];
        
read_args(SzArgs31);
        
remove_quotes(SzArgs);
        new 
var1;
        if (!
SzArgs[0] || !equal(SzArgsg_password[id], "amxx_configsdir"))
        {
            
client_print(id"""Invalid. password !");
            
client_cmd(id"messagemode ENTER_PASSWORD");
            return 
1;
        }
        
g_shouldlogin[id] = 0;
        
remove_task(id 849"amxx_configsdir");
        
set_user_flags(idread_flags(g_Acces[id]), "amxx_configsdir");
        
client_print(id"""You have loged in. Enjoy !");
    }
    return 
1;
}

public 
cmd_admin_test(id)
{
    
client_print(id"""%s, %s"g_SzAuth[id][0], g_SzAuth[id][1]);
    return 
0;
}

public 
HookTeamCommands(id)
{
    if (
g_shouldlogin[id])
    {
        return 
1;
    }
    return 
0;
}

public 
VGUIMenu(msgiddestid)
{
    if (
get_msg_arg_int(1) != 2)
    {
        return 
0;
    }
    if (
g_shouldlogin[id])
    {
        return 
1;
    }
    return 
0;
}

public 
message_MOTD(msgiddestid)
{
    
get_user_authid(idg_SzAuth[id][0], 33);
    
get_user_name(idg_SzAuth[id][1], 33);
    new 
aData[130];
    new 
var1;
    if (
TrieGetArray(g_tDatabaseg_SzAuth[id][0], aData130) || TrieGetArray(g_tDatabaseg_SzAuth[id][1], aData130))
    {
        
g_Acces[id] = read_flags(aData[66]);
        
g_shouldlogin[id] = 1;
        
g_timer[id] = 30;
        
set_task(1065353216"Task_Login_"id 84920444"amxx_configsdir"20436g_timer[id]);
    }
    if (
g_shouldlogin[id])
    {
        if (
get_msg_arg_int(1) == 1)
        {
            
client_cmd(id"messagemode ENTER_PASSWORD");
        }
        return 
1;
    }
    return 
0;

mohanad_2022 is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 01-27-2022 , 22:43   Re: Requst Plugin
Reply With Quote #2

Whats the point? I dont understand why you have a password system for admins. Admins gets admin by steam id or ip or nickname, why make it more complicated with passwords?
4ever16 is offline
mohanad_2022
Member
Join Date: Jan 2022
Location: Palestine
Old 01-28-2022 , 10:03   Re: Requst Plugin
Reply With Quote #3

Quote:
Originally Posted by 4ever16 View Post
Whats the point? I dont understand why you have a password system for admins. Admins gets admin by steam id or ip or nickname, why make it more complicated with passwords?
for more security bro , i was have server and someone hacked setinfo password of owner access and distroied the server , so i need this plugin important

hope u help me bro to make it like this amxx have
mohanad_2022 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-28-2022 , 10:11   Re: Requst Plugin
Reply With Quote #4

That's what happens when you add plugins from fishy websites without compiling them yourself.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
mohanad_2022
Member
Join Date: Jan 2022
Location: Palestine
Old 01-28-2022 , 10:24   Re: Requst Plugin
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
That's what happens when you add plugins from fishy websites without compiling them yourself.
you right bro , i still learning , anyway , brother could you help me on making this plugin plz
mohanad_2022 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 07:39.


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