[HELP]Ladmin Register and Login In Dialog[SATDMv9][FAST][REP++]
#1

Hi

I want a Code Of Ladmin Script Which Has Register and Login In Dialog .SATDM v9

Player Info
Код:
enum pInfo
{
	name[MAX_PLAYER_NAME],
	bowner,
	bowned,
	pass,
	pcash,
	bank,
	team,
	Jailed,
	vhpb,
	weed,
	gang,
	condoms,
	inalcatraz,
	
	Registered,
	LoggedIn,
	Level,
	Muted,
	Caps,
	LJailTime,
	Frozen,
	FreezeTime,
	Kills,
	Deaths,
	hours,
	mins,
	secs,
	TotalTime,
	ConnectTime,
 	MuteWarnings,
	Warnings,
	Spawned,
	TimesSpawned,
	God,
	DoorsLocked,
	SpamCount,
	SpamTime,
	PingCount,
	PingTime,
	BotPing,
	pPing[PING_MAX_EXCEEDS],
	blip,
	blipS,
	pColour,
	SpecID,
	SpecType,
	bool:AllowedIn,
	FailLogin,
	vowned,
	vowner,
	vowned2,
	vowner2,
	vowned3,
	vowner3,
	vowned4,
	vowner4,
	vowned5,
	vowner5,
	vowned6,
	vowner6,
	vowned7,
	vowner7,
	vowned8,
	vowner8,
	vowned9,
	vowner9,
	vowned10,
	vowner10,
	vowned11,
	vowner11,
	vowned12,
	vowner12,
	vowned13,
	vowner13,
	vowned14,
	vowner14,
	vowned15,
	vowner15,
}

new PlayerInfo[MAX_PLAYERS][pInfo];
On player Spawn

Код:
	if(ServerInfo[Locked] == 1 && PlayerInfo[playerid][AllowedIn] == false)
	{
		GameTextForPlayer(playerid,"~r~Server Locked~n~You must enter password before spawning~n~/password <password>",4000,3);
		SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
		return 1;
	}

	if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
	{
		GameTextForPlayer(playerid,"~r~Before you can play, you must login!",4000,3);
//		new paramsl[128];
//		ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Login Password", paramsl, "OK", "Cancel"); //Broken
		SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
		return 1;
	}

	if(ServerInfo[MustRegister] == 1 && PlayerInfo[playerid][Registered] == 0)
	{
		new params[128];
		GameTextForPlayer(playerid,"~r~Before you can play, you must register!",4000,3);
		ShowPlayerDialog(playerid, DIALOGID0+1, DIALOG_STYLE_INPUT,"Password", params, "OK", "Cancel");
		SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
		return 1;
	}
On Dialog Response
Код:
   if(dialogid == DIALOGID0+1)
	{
		if(response)
		{
		    cmd_register(playerid,inputtext);
			if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already registered and logged in.");
		    if (udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: This account already exists, please use '/login [password]'.");
		    if (strlen(inputtext) < 4 || strlen(inputtext) > 20) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Password length must be greater than three characters");
		    if (udb_Create(PlayerName2(playerid),inputtext))
			{
		    	new file[256],rname[MAX_PLAYER_NAME], tmp3[100];
		    	new strdate[20], year,month,day;
				getdate(year, month, day);
				GetPlayerName(playerid,rname,sizeof(rname));
				format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(rname));
		     	GetPlayerIp(playerid,tmp3,100);
				dini_Set(file,"ip",tmp3);
		//    	dini_Set(file,"password",params);
			    dUserSetINT(PlayerName2(playerid)).("registered",1);
		   		format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year);
				dini_Set(file,"RegisteredDate",strdate);
				dUserSetINT(PlayerName2(playerid)).("loggedin",1);
				dUserSetINT(PlayerName2(playerid)).("banned",0);
				dUserSetINT(PlayerName2(playerid)).("level",0);
			    dUserSetINT(PlayerName2(playerid)).("LastOn",0);
		    	dUserSetINT(PlayerName2(playerid)).("money",0);
		    	dUserSetINT(PlayerName2(playerid)).("kills",0);
			   	dUserSetINT(PlayerName2(playerid)).("deaths",0);
			    PlayerInfo[playerid][LoggedIn] = 1;
			    PlayerInfo[playerid][Registered] = 1;
			    SendClientMessage(playerid, green, "ACCOUNT: You are now registered, and have been automaticaly logged in");
				PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
				return 1;
			}
		}
		return 1;
	}
    if(dialogid == DIALOGID0+2)
	{
		if(response)
		{
		    cmd_login(playerid,inputtext);
		    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already logged in.");
		    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
		    if (udb_CheckLogin(PlayerName2(playerid),inputtext))
			{
			   	new file[256], tmp3[100], lname[MAX_PLAYER_NAME];
				GetPlayerName(playerid,lname,sizeof(lname));
			   	format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
		   		GetPlayerIp(playerid,tmp3,100);
			   	dini_Set(file,"ip",tmp3);
				LoginPlayer(playerid);
				PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
				if(PlayerInfo[playerid][Level] > 0) {
					format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] );
					return SendClientMessage(playerid,green,string);
		       	} else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
			}*/
			return	ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Password", "WRONG Password, Try Again", "OK", "Cancel");
		}
		return 1;
	}
On player disconnect

Код:
	if(PlayerInfo[playerid][LoggedIn] == 1)	SavePlayer(playerid);
	if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("loggedin",0);
I Think i Given You All Things Also In Attactments FILES
Please Help Me .Get REP++


----------------------------------------------------------------------------------------------------------------


----------------------------------------------------------------------------------------------------------------
__________________________________________________ ________________________________________________
Reply
#2

Use YSI INI, for saving INI Files, in a folder with all informations of users, is the fast way for that you want.
Reply
#3

Hi there.

First, you need at least 50 messages to give rep, so stop lying in your thread title (I knew before clicking).
Secondly, a few person will give you a ready-made code that you only need to copy and paste in your GameMode.
Thirdly, your thread is very well presented, it's wasting time because your question hasn't any reason to be.
Of course, if we made your code, you'll just copy it without understanding anything about what you do (I could give you a code like that

PHP код:

new MySQL;

MySQL mysql_connect("127.0.0.1""root""samp""");

public 
OnPlayerRequestSpawn(playerid)
{
    
ShowPlayerRegisterDialog();
    
mysql_tquery(MySQL"DELETE * FROM `Players`""OnPlayerRegister""i"playerid);

And you'll get fucked by a man who just wanted to fuck you but who wanted you to believe he helped you.

So learn the pawn (which is a pretty easy language compared to C++) and do it by yourself.
Reply
#4

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
Use YSI INI, for saving INI Files, in a folder with all informations of users, is the fast way for that you want.
Can You Edited Code To dialog ??Please??
Enjoy REP++ For Replaying
Reply
#5

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Hi there.

First, you need at least 50 messages to give rep, so stop lying in your thread title (I knew before clicking).
Secondly, a few person will give you a ready-made code that you only need to copy and paste in your GameMode.
Thirdly, your thread is very well presented, it's wasting time because your question hasn't any reason to be.
Of course, if we made your code, you'll just copy it without understanding anything about what you do (I could give you a code like that

PHP код:

new MySQL;
MySQL mysql_connect("127.0.0.1""root""samp""");
public 
OnPlayerRequestSpawn(playerid)
{
    
ShowPlayerRegisterDialog();
    
mysql_tquery(MySQL"DELETE * FROM `Players`""OnPlayerRegister""i"playerid);

And you'll get fucked by a man who just wanted to fuck you but who wanted you to believe he helped you.

So learn the pawn (which is a pretty easy language compared to C++) and do it by yourself.
Only Click on Yellow Star to get REP
Why You Replaying like this ?? Only just Tell me or Create
Reply
#6

ANY ONE PLEASE HELP ME
Reply
#7

OnPlayerSpawn

pawn Код:
if(ServerInfo[Locked] == 1 && PlayerInfo[playerid][AllowedIn] == false)
    {
        GameTextForPlayer(playerid,"~r~Server Locked~n~You must enter password before spawning~n~/password <password>",4000,3);
        SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
        return 1;
    }

    if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
    {
        GameTextForPlayer(playerid,"~r~Before you can play, you must login!",4000,3);
        new paramsl[128];
        ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Login Password", paramsl, "OK", "Cancel"); //Broken
        SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
        return 1;
    }

    if(ServerInfo[MustRegister] == 1 && PlayerInfo[playerid][Registered] == 0)
    {
        new params[128];
        GameTextForPlayer(playerid,"~r~Before you can play, you must register!",4000,3);
        ShowPlayerDialog(playerid, DIALOGID0+1, DIALOG_STYLE_INPUT,"Password", params, "OK", "Cancel");
        SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
        return 1;
    }
Under OnDialogResponse uncomment that last part */ and /* remove those.
pawn Код:
}*/
            return  ShowPlayerDialog(playerid, DIALOGID0+2, DIALOG_STYLE_INPUT,"Password", "WRONG Password, Try Again", "OK", "Cancel");
        }
        return 1;
Reply
#8

Thanks For REPLAY but */ that is not the problem .ah?

ADD*+

Any way i have requested for FREE SA-MP SERVER
Reply
#9

Quote:
Originally Posted by paulbobin
Посмотреть сообщение
Thanks For REPLAY but */ that is not the problem .ah?

ADD*+

Any way i have requested for FREE SA-MP SERVER
It is,

By doing this */ at starting of the code and doing this /* at end of the code, This will comment that code pard and wont be functioned in game untill you remove */ & /*.
Reply
#10

Quote:
Originally Posted by Bingo
Посмотреть сообщение
It is,

By doing this */ at starting of the code and doing this /* at end of the code, This will comment that code pard and wont be functioned in game untill you remove */ & /*.
Ok I will do .



If Your are the owner of FreactalHub
Can You please Add 3c Server
How to use FTP In your website that is not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)