Raised This Month: $ Target: $400
 0% 

Server set Auto-Password


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
youssef_randy
Junior Member
Join Date: Dec 2016
Location: Morocco
Old 12-25-2016 , 12:32   Server set Auto-Password
Reply With Quote #1

Hello alliedmods Users!
First Thanks for visiting my thread ,I'm New Here & i just want to get some help in my server
it's too Yong & when 10 players join the server,it make password automatically, if u can help me in this issue i'll be thankful for your support. & Happy Xmas!
youssef_randy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-25-2016 , 12:48   Re: Server set Auto-Password
Reply With Quote #2

Welcome. FYI, the Scripting Help section of the forum is for people who are writing their own plugins (or modifying code on their own) to get help with their code. So, please post the code that you have tried and we can attempt to help you. Also, when you do, you should ask specific questions.

If you are not writing this plugin and want someone else to write it for you, you'll need to post in the Suggestions/Requests section of the forum.
__________________
fysiks is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-25-2016 , 16:34   Re: Server set Auto-Password
Reply With Quote #3

I didn't understand well, you want to automatically set a password if there is 10 players?
I'm not sure if this will work but.. Test it

PHP Code:
#include <amxmodx>

#define PLUGIN "10+ Players Change PW"
#define VERSION "1.0"
#define AUTHOR "DoNii"

#define your_password "x1x2x3"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id) {
    
    new 
iPlayers32 ], iNum
    
get_playersiPlayersiNum"ch" ); 
    
    if(
iNum == 10) {
        
        
server_cmd("sv_password ^"%d^""your_password)
    }

__________________

Last edited by edon1337; 12-26-2016 at 16:25.
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-25-2016 , 17:58   Re: Server set Auto-Password
Reply With Quote #4

Why only numbers?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-26-2016 , 00:33   Re: Server set Auto-Password
Reply With Quote #5

Try, don't tested.

PHP Code:
#include <amxmodx>

#define PLUGIN "Auto server password"
#define VERSION "1.0"
#define AUTHOR "EFFx"

new Password

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
Password register_cvar("password_charac","ab103@aM!")
}
public 
client_putinserver(id)
{
    new 
szPlayers[32], iPlayersNum
    get_players
(szPlayers,iPlayersNum,"ch")
    
    if(
iPlayersNum == 10)
    {
        new 
szPassword[20]
        
get_pcvar_string(Password,szPassword,charsmax(szPassword))
        
server_cmd("sv_password ^"%s^"",szPassword)
    }
}
public 
client_disconnect(id)
{
    new 
szPlayers[32], iPlayersNum
    get_players
(szPlayers,iPlayersNum,"ch")
    
    if(
iPlayersNum 10)
    {
        
server_cmd("sv_password ^" ^"")
    }

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-26-2016 at 00:36.
EFFx is offline
youssef_randy
Junior Member
Join Date: Dec 2016
Location: Morocco
Old 12-26-2016 , 11:25   Re: Server set Auto-Password
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Welcome. FYI, the Scripting Help section of the forum is for people who are writing their own plugins (or modifying code on their own) to get help with their code. So, please post the code that you have tried and we can attempt to help you. Also, when you do, you should ask specific questions.

If you are not writing this plugin and want someone else to write it for you, you'll need to post in the Suggestions/Requests section of the forum.
I really appreciate Your reply, and i'm sorry i'll try my best!
youssef_randy is offline
youssef_randy
Junior Member
Join Date: Dec 2016
Location: Morocco
Old 12-26-2016 , 11:26   Re: Server set Auto-Password
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
Try, don't tested.

PHP Code:
#include <amxmodx>

#define PLUGIN "Auto server password"
#define VERSION "1.0"
#define AUTHOR "EFFx"

new Password

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
Password register_cvar("password_charac","ab103@aM!")
}
public 
client_putinserver(id)
{
    new 
szPlayers[32], iPlayersNum
    get_players
(szPlayers,iPlayersNum,"ch")
    
    if(
iPlayersNum == 10)
    {
        new 
szPassword[20]
        
get_pcvar_string(Password,szPassword,charsmax(szPassword))
        
server_cmd("sv_password ^"%s^"",szPassword)
    }
}
public 
client_disconnect(id)
{
    new 
szPlayers[32], iPlayersNum
    get_players
(szPlayers,iPlayersNum,"ch")
    
    if(
iPlayersNum 10)
    {
        
server_cmd("sv_password ^" ^"")
    }

Thanks for your Hard Work Bro!
youssef_randy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-26-2016 , 16:26   Re: Server set Auto-Password
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Why only numbers?
Uhh, I'm used to Facebook and other social media's method Should be fixed now?
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-26-2016 , 18:20   Re: Server set Auto-Password
Reply With Quote #9

I'm pretty sure Facebook forces you to use a mix of capital letters, normal letrers and numbers.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-26-2016 , 20:05   Re: Server set Auto-Password
Reply With Quote #10

It's extremely unlike that someone would want significant complexity in a server password that the server admin would expect someone to use. If the admin of the server is expecting that nobody use the password at all then I guess you can make it as complex as you want.
__________________
fysiks 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 20:10.


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