Score and Money Save! Help!
#1

Well i can't figure out how to save score and money!! Can somebody help me!
Here will be code:

Код:
public OnPlayerConnect(playerid)
{
	Login[playerid] = 0;
	new name[MAX_PLAYER_NAME], archive[256];
	GetPlayerName(playerid, name, sizeof(name));
	format(archive, sizeof(archive), "/Users/%s.ini", name);
	if (!dini_Exists(archive))
	{
	    ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter your password please:", "Accept", "Cancel");
	}
	else
	{
	    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password please:", "Accept", "Cancel");
	}
	return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if (dialogid == Register)
	{
	    new name[MAX_PLAYER_NAME], archive[256];
	    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter your password please", "Accept", "Cancel");
	    if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter your password please:", "Accept", "Cancel");
	    GetPlayerName(playerid, name, sizeof(name));
	    format(archive, sizeof(archive), "/Users/%s.ini", name);
	    dini_Create(archive);
	    dini_Set(archive, "User", name);
	    dini_Set(archive, "Password", inputtext);
	    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password please", "Accept", "Cancel");
	}
	if (dialogid == Logged)
	{
	    new name[MAX_PLAYER_NAME], archive[256], proof[256];
	    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password please", "Accept", "Cancel");
	    if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password please", "Accept", "Cancel");
	    GetPlayerName(playerid, name, sizeof(name));
	    format(archive, sizeof(archive), "/Users/%s.ini", name);
	    format(proof, sizeof(proof), "%s", dini_Get(archive, "Password"));
	    if (!strcmp (inputtext, proof))
	    {
		}
	    else
	    {
	        ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password please", "Accept", "Cancel");
	    }
	}
	return 1;
}
Reply


Messages In This Thread
Score and Money Save! Help! - by Kasis - 09.02.2011, 14:00
Re: Score and Money Save! Help! - by HyperZ - 09.02.2011, 14:10

Forum Jump:


Users browsing this thread: 1 Guest(s)