Login System Help [DINI]
#1

Hi, I'm italian, sorry for bad english.

I've created a login/register system in my Server, but there's a problem with login system.

Look the script:
Код:
	new string[256];
	new pName[24];
	new pIP[16];
	new pPing;
	pPing = GetPlayerPing(playerid);
    new File[256];
    format(File,sizeof(File),PATH,pName);
    if(dini_Exists(File))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"GeS - Login",""COL_WHITE"Utente registrato. Scrivi la password per accedere.","Entra","Esci");
    }
	else
    {
	    GetPlayerName(playerid,pName,sizeof(pName));
	    format(string,sizeof(string),"~g~Benvenuto ~w~nel ~r~server~w~, ~y~%s",pName);
	    GameTextForPlayer(playerid,string,5000,5);
	    format(string,sizeof(string),"{33FF00}%s {FFFFFF}si и connesso. {FF0000}ID: %d",pName,playerid);
	    SendClientMessageToAll(COLOR_WHITE,string);
    	GetPlayerIp(playerid,pIP,sizeof(pIP));
	    format(string,sizeof(string),"[NEW]%s si и connesso. ID: %d | IP: %s | PING: %d",pName,playerid,pIP,pPing);
	    print(string);
    }
This is OnPlayerConnect. When I connect to Server and i'm registered, It does not show the login dialog. Why?
Reply
#2

my reply will be kinda offtopic so don't mind if you don't like my reply..

I have never used dini, INI is much easier and you should use INI...
and about this problem

instead of

pawn Код:
if(dini_Exists(File))
try using

pawn Код:
if(fexist(File))
I guess fexist might work
Reply
#3

Uhm, Thanks for reply, but there's the same problem .. :/
Reply
#4

a few more tips you might try-
try looking at the dialog ids, you might have mixed up some
try checking out the PATH define


If you are using any filterscript, remove OnDialogResponse callback from it
Reply
#5

I don't know what PATH is but I suggest you to use and format(file, sizeof(file), "%s.ini", GetPlayerName(playerid)); and so on.
Reply
#6

#define PATH "/GeS/Users/%s.ini" ...
Reply
#7

Heeeeeelp me. xD Up
Reply
#8

Resolved, thanks at all The problem was an order problem, with pName in format(File,sizeof(File,PATH,pName)); ... Close please:3
Reply
#9

I would put in a recommendation that you should refrain from using DINI. Try YINI if you don't want to use MySQL.
Reply
#10

Quote:
Originally Posted by DanyelKing
Посмотреть сообщение
Hi, I'm italian, sorry for bad english.

I've created a login/register system in my Server, but there's a problem with login system.

Look the script:
Код:
	new string[256];
	new pName[24];
	new pIP[16];
	new pPing;
	pPing = GetPlayerPing(playerid);
    new File[256];
    format(File,sizeof(File),PATH,pName);
    if(dini_Exists(File))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"GeS - Login",""COL_WHITE"Utente registrato. Scrivi la password per accedere.","Entra","Esci");
    }
	else
    {
	    GetPlayerName(playerid,pName,sizeof(pName));
	    format(string,sizeof(string),"~g~Benvenuto ~w~nel ~r~server~w~, ~y~%s",pName);
	    GameTextForPlayer(playerid,string,5000,5);
	    format(string,sizeof(string),"{33FF00}%s {FFFFFF}si и connesso. {FF0000}ID: %d",pName,playerid);
	    SendClientMessageToAll(COLOR_WHITE,string);
    	GetPlayerIp(playerid,pIP,sizeof(pIP));
	    format(string,sizeof(string),"[NEW]%s si и connesso. ID: %d | IP: %s | PING: %d",pName,playerid,pIP,pPing);
	    print(string);
    }
This is OnPlayerConnect. When I connect to Server and i'm registered, It does not show the login dialog. Why?
You haven't used 'GetPlayerName' function to get the name of the player. Just created a var named 'pName'. Maybe because of that, it couldn't detect any files.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)