How to make a password lock command when not enough level
#1

Can someone help me make a lock command when entering a server that needs to reach level 3 or higher to be allowed to access and an order to unlock normal access?
Here is my login code
Код:
stock ShowMainMenuDialog(playerid, frame)
{
	new titlestring[64];
	new string[512];

	switch(frame)
	{
		case 1:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang nhap - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Chao mung den voi may chu GTA-RP.VN, %s.\n\nTen cua ban da duoc dang ki, Nhap PASSWORD de dang nhap:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Dang Nhap","Thoat");
		}
		case 2:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang ki - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Chao mung den voi may chu GTA-RP.VN, %s.\n\n{FFFFFF}Ban co the {AA3333}Dang ki {FFFFFF}tai khoan moi bang cach nhap PASSWORD o day:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_PASSWORD,titlestring,string,"Dang Ki","Thoat");
		}
		case 3:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang nhap - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Sai Password!\n\nChao mung den voi may chu GTA-RP.VN, %s.\n\nTen cua ban da duoc dang ki, Dien PASSWORD de dang nhap:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Dang Nhap","Thoat");
		}
		case 4:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Account Locked - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Hien tai, Tai khoan: %s hien dang dang nhap, neu khong phai la ban vui long lien he mot quan tri Administrator de duoc giai quyet.", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU3,DIALOG_STYLE_MSGBOX,titlestring,string,"Thoat","");
		}
	}
}
Reply
#2

What do you mean? More explanation please?
Reply
#3

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
What do you mean? More explanation please?
That is, I would make a command to block non-level players from accessing the server and an open command
Reply
#4

lol tho,How ever, It is not a "command" it will be a function under OnPlayerConnect which will kick the player after his login phase, I mean you want it like if the player log in and his level is less than level 3 we should kick him?
Reply
#5

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
lol tho,How ever, It is not a "command" it will be a function under OnPlayerConnect which will kick the player after his login phase, I mean you want it like if the player log in and his level is less than level 3 we should kick him?
And will I need an unlock command to do that?
Reply
#6

ahh you want to do this using a lock cmd and unlock it using an unlock command?
Reply
#7

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
ahh you want to do this using a lock cmd and unlock it using an unlock command?
Yes you can help me, I'm sorry I'm Vietnamese my bad english
Reply
#8

IDK why do you need this system while having RCON system that can lock the server.

Anyway

PHP код:
new serverlocked 0;
CMD:lockserver(playeridparams[])
{
     if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You are not an administrator!");
     if(
serverlocked == 1)
     {
            
serverlocked 0;
            
SendClientMessage(playeridCOLOR_RED"The server is now unlocked!");
      }
      else
      {
            
serverlocked 1;
            
SendClientMessage(playeridCOLOR_RED"The server is now locked!");
       }

Show me your login system code....
Reply
#9

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
IDK why do you need this system while having RCON system that can lock the server.

Anyway

PHP код:
new serverlocked 0;
CMD:lockserver(playeridparams[])
{
     if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You are not an administrator!");
     if(
serverlocked == 1)
     {
            
serverlocked 0;
            
SendClientMessage(playeridCOLOR_RED"The server is now unlocked!");
      }
      else
      {
            
serverlocked 1;
            
SendClientMessage(playeridCOLOR_RED"The server is now locked!");
       }

Show me your login system code....
Код:
stock ShowMainMenuDialog(playerid, frame)
{
	new titlestring[64];
	new string[512];

	switch(frame)
	{
		case 1:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang nhap - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Well Come To Server GTA-RP.VN, %s.\n\nYour name has been registered for a password to login:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Thoat");
		}
		case 2:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang ki - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Well Come To Server GTA-RP.VN, %s.\n\n{FFFFFF}You Can {AA3333}register{FFFFFF}By entering a password here:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_PASSWORD,titlestring,string,"Dang Ki","Thoat");
		}
		case 3:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Dang nhap - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Well Come To Server GTA-RP.VN, %s.\n\nYour name has been registered for a password to login:", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_PASSWORD,titlestring,string,"Login","Thoat");
		}
		case 4:
		{
			format(titlestring, sizeof(titlestring), "{3399FF}Account Locked - %s", GetPlayerNameEx(playerid));
			format(string, sizeof(string), "{FFFFFF}Currently, Account: %s is currently logged in, If not you please contact the administrator to be resolved.", GetPlayerNameEx(playerid));
			ShowPlayerDialog(playerid,MAINMENU3,DIALOG_STYLE_MSGBOX,titlestring,string,"Thoat","");
		}
	}
}
}
Reply
#10

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
IDK why do you need this system while having RCON system that can lock the server.

Anyway

PHP код:
new serverlocked 0;
CMD:lockserver(playeridparams[])
{
     if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"You are not an administrator!");
     if(
serverlocked == 1)
     {
            
serverlocked 0;
            
SendClientMessage(playeridCOLOR_RED"The server is now unlocked!");
      }
      else
      {
            
serverlocked 1;
            
SendClientMessage(playeridCOLOR_RED"The server is now locked!");
       }

Show me your login system code....
Код:
if(dialogid == MAINMENU || dialogid == MAINMENU2)
	{
		if(response == 0)
		{
			SendClientMessage(playerid, COLOR_RED, "SERVER: Ban tu dong bi kick ra.");
			SetTimerEx("KickEx", 1000, 0, "i", playerid);
		}
		else if(dialogid == MAINMENU)
		{
			if(!isnull(inputtext) && strlen(inputtext) < 64)
			{
				SetPVarString(playerid, "PassAuth", inputtext);
				g_mysql_AccountLoginCheck(playerid);
			}
			else
			{
				ShowMainMenuDialog(playerid, 1);
			}
		}
		else if(dialogid == MAINMENU2)
		{
			if(!isnull(inputtext) && strlen(inputtext) < 64)
			{
				SetPVarString(playerid, "PassAuth", inputtext);
				g_mysql_CreateAccount(playerid, inputtext);
			}
		}
		return 1;
	}
	if(dialogid == MAINMENU3)
	{
		Kick(playerid);
	}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)