Jump to content
Sign in to follow this  
johny305

Need login system

Recommended Posts

Hello i been trying to make a mod so when you join the server it will show a login screen where the user has to login to be able to play i have mysql functional already i just need a login screen if any one could please help out would be greatly appreciated

Share this post


Link to post
Share on other sites

???

do you want an actual login system, or a cencept of login system, or just only a login screen?

as for login screen, you can use the gui editor.

Share this post


Link to post
Share on other sites

It should work with the way Zatan13th said use the GUI editor then link everything up.

Share this post


Link to post
Share on other sites

I am not sure how to show a login screen as soon as the user join the server (don't know if it's even possible), but creating a login form with dialogs is quite easy. Here's a sample:

defines.hpp (Arma base classes)

http://pastebin.com/Eib9Prk4

LoginForm.hpp

class LoginForm
{
name = "LoginForm";
idd = 3400;
movingEnable = false;

class controls {

	class LoginForm_usr : RscEdit {
		colorBackground[] = {0, 0, 0, 1};
		idc = 3401;
		x = 0.1999;
		y = 0.074;
		w = 0.6;
		h = 0.05;
	};

	class LoginForm_pwd : RscEdit {
		colorBackground[] = {0, 0, 0, 1};
		idc = 3402;
		x = 0.1999;
		y = 0.154;
		w = 0.6;
		h = 0.05;
	};

	class LoginForm_button: RscButton
	{
		idc = 3403;
		text = "LOGIN";
		x = 0.1999;
		y = 0.224;
		w = 0.6;
		h = 0.05;
		action = "closeDialog 3400; hint format[""User: %1 - Pass: %2"", ctrlText 3401, ctrlText 3402];";
	};
};
};

Put those files on your mission root, then add the following to your Description.ext file:

#include "defines.hpp"
#include "LoginForm.hpp"

Now you can open the dialog from the debug console (or from anywhere you want) with:

createDialog "LoginForm";

The login form I created is not aligned or anything, it's just a quick sample for testing so you can see how to read the textboxes input. When you click the login button it will close the dialog and show a hint with the user and pass the user input.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×