Raised This Month: $ Target: $400
 0% 

[REQ] Password plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 06-13-2013 , 17:25   [REQ] Password plugin
Reply With Quote #1

Can someone make a plugin that if 10 players on server it will set a random password, when are less than 10 players it will set no password.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 06-14-2013 , 00:15   Re: [REQ] Password plugin
Reply With Quote #2

I was bored ^^
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Password"
#define VERSION "1.0"
#define AUTHOR "Airshot"

new iPlayer
new player_needed
new bool:isPassword false

new const PasswordsList[][] =
{
    
"gzeiai",
    
"174657867",
    
"drunkloraoajgel",
    
"ezhjezhz",
    
"gzyhekuykr",
    
"e8yh4eyh4ezz4",
    
"grehgehth8egzz5g15",
    
"vcbezgzkeotaiua8"

};

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
player_needed register_cvar("p_needed""10")
    
}
public 
client_putinserver(id)
{
    
iPlayer++
    
set_task(0.1"Check")
}

public 
client_disconnect(id)
{
    
iPlayer--
    
set_task(0.1"Check")
}

public 
Check()
{
    if (
iPlayer >= get_pcvar_num(player_needed) && !isPassword
    {
        
ChangePassword()
    }
    if (
iPlayer get_pcvar_num(player_needed) && isPassword
    {
        
server_cmd("sv_password none")
        
client_print(0print_chat,"Server password has been removed because there is less than %i player connected on the server."get_pcvar_num(player_needed));
        
isPasswordfalse
    
}

}

public 
ChangePassword()
{
    new 
command[25];
    new 
randompassword random_num(0charsmax(PasswordsList));
    
format(command,24,"sv_password %s"PasswordsList[randompassword]);
    
server_cmd(command);
    
isPasswordtrue;

Probably not the most efficient way to do it but it should work.
__________________
AirShot is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 06-14-2013 , 07:23   Re: [REQ] Password plugin
Reply With Quote #3

Quote:
Originally Posted by AirShot View Post
I was bored ^^
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Password"
#define VERSION "1.0"
#define AUTHOR "Airshot"

new iPlayer
new player_needed
new bool:isPassword false

new const PasswordsList[][] =
{
    
"gzeiai",
    
"174657867",
    
"drunkloraoajgel",
    
"ezhjezhz",
    
"gzyhekuykr",
    
"e8yh4eyh4ezz4",
    
"grehgehth8egzz5g15",
    
"vcbezgzkeotaiua8"

};

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
player_needed register_cvar("p_needed""10")
    
}
public 
client_putinserver(id)
{
    
iPlayer++
    
set_task(0.1"Check")
}

public 
client_disconnect(id)
{
    
iPlayer--
    
set_task(0.1"Check")
}

public 
Check()
{
    if (
iPlayer >= get_pcvar_num(player_needed) && !isPassword
    {
        
ChangePassword()
    }
    if (
iPlayer get_pcvar_num(player_needed) && isPassword
    {
        
server_cmd("sv_password none")
        
client_print(0print_chat,"Server password has been removed because there is less than %i player connected on the server."get_pcvar_num(player_needed));
        
isPasswordfalse
    
}

}

public 
ChangePassword()
{
    new 
command[25];
    new 
randompassword random_num(0charsmax(PasswordsList));
    
format(command,24,"sv_password %s"PasswordsList[randompassword]);
    
server_cmd(command);
    
isPasswordtrue;

Probably not the most efficient way to do it but it should work.

Dont work.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Serkan Kischa
Member
Join Date: Dec 2012
Old 06-14-2013 , 07:25   Re: [REQ] Password plugin
Reply With Quote #4

Lol
Serkan Kischa is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-14-2013 , 10:28   Re: [REQ] Password plugin
Reply With Quote #5

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new bool:is_locked;
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
client_disconnect(id) {
    if(
is_lockedCheck()
}
public 
client_putinserver(id) {
    if(!
is_lockedCheck()
}
public 
Check() {
    new 
players[32],inum;
    
get_players(players,inum)
    
    if(
inum >= 10 && !is_locked) {
        new 
pass random_num(100000,999999);
        new 
szPass[7];num_to_str(pass,szPass,6)
        
set_cvar_string("sv_password",szPass)
        
is_locked true;
    }
    else if(
is_locked) {
        
set_cvar_string("sv_password","")
        
is_locked false;
    }


Last edited by akcaliberg; 06-14-2013 at 10:31.
akcaliberg is offline
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 06-14-2013 , 11:08   Re: [REQ] Password plugin
Reply With Quote #6

Quote:
Originally Posted by quark View Post
Dont work.
Just tested it and it work fine for me It does what you asked for
__________________
AirShot is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 06-14-2013 , 12:06   Re: [REQ] Password plugin
Reply With Quote #7

Quote:
Originally Posted by AirShot View Post
Just tested it and it work fine for me It does what you asked for
Yeah , it works
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 06-14-2013 , 12:07   Re: [REQ] Password plugin
Reply With Quote #8

Quote:
Originally Posted by quark View Post
Yeah , it works
lol
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)
Smatify 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 13:44.


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