enum pInfo
{
pPass,
pHasCondom,
pPackCondom,
Money,
Spawned,
pHasPack,
pHasCigar,
pPackCigars,
pPackSnack,
pHasSnack,
pAdminLevel,
pHasSmoked,
}
new AccountInfo[MAX_PLAYERS][pInfo];
if (dialogid == DIALOG_REGISTER)
{
//SetTimerEx("SkipSpawn",3,0,"i",playerid);//It's required to have atleast 1 millisecond
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{9ACD32}ILSRP - Register{FFFFFF}", "{FFFFFF}You have joined under a non registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Enter the password you will remember){FFFFFF}", "Register", "Quit");
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "HasCondom",AccountInfo[playerid][pHasCondom] = 0);
dini_IntSet(file, "PackCondom",AccountInfo[playerid][pPackCondom] = 0);
dini_IntSet(file, "HasCigar",AccountInfo[playerid][pHasCigar] = 0); //pHasCigar
dini_IntSet(file, "HasPack",AccountInfo[playerid][pHasPack] = 0);
dini_IntSet(file, "PackSnack",AccountInfo[playerid][pPackSnack] = 0);
dini_IntSet(file, "AdminLevel",AccountInfo[playerid][pAdminLevel] = 0);
dini_IntSet(file, "PackCigars",AccountInfo[playerid][pPackCigars] = 0);
dini_IntSet(file, "HasSnack",AccountInfo[playerid][pHasSnack] = 0);
dini_IntSet(file, "Money", SetPlayerMoney(playerid, 1500));
dini_IntSet(file, "Score", SetPlayerScore(playerid, 1));
dini_IntSet(file, "Skin", SetPlayerSkin(playerid, 230)); // this skin
gPlayerLogged[playerid] = 1;
}
if (dialogid == DIALOG_LOGIN)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Welcome back!", "Welcome back to ILSRP!\n\nType in your password below to login", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Welcome back!", "Welcome back to ILSRP!\n\nType in your password below to login", "Login", "Leave");
}
else
{
//SetTimerEx("SkipSpawn",3,0,"i",playerid);//It's required to have atleast 1 millisecond
TogglePlayerSpectating(playerid, 0);
gPlayerLogged[playerid] = 1;
AccountInfo[playerid][pHasCondom] = dini_Int(file, "HasCondom");
AccountInfo[playerid][pPackCondom] = dini_Int(file, "PackCondom");
AccountInfo[playerid][pHasPack] = dini_Int(file, "HasPack");
AccountInfo[playerid][pHasCigar] = dini_Int(file, "HasCigar"); //pHasCigar
AccountInfo[playerid][pPackCigars] = dini_Int(file, "PackCigar");
AccountInfo[playerid][pPackSnack] = dini_Int(file, "PackSnack");
AccountInfo[playerid][pHasSnack] = dini_Int(file, "HasSnack");
AccountInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
SetPlayerMoney(playerid, dini_Int(file, "Money"));
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerSkin(playerid, dini_Int(file, "Skin"));
}
}
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "HasCondom", AccountInfo[playerid][pPackCondom]);
dini_IntSet(file, "PackCondom",AccountInfo[playerid][pPackCondom]);
dini_IntSet(file, "HasPack",AccountInfo[playerid][pHasPack]);
dini_IntSet(file, "HasCigar",AccountInfo[playerid][pHasCigar]); // pHasCigar
dini_IntSet(file, "PackCigars",AccountInfo[playerid][pPackCigars]);
dini_IntSet(file, "PackSnack",AccountInfo[playerid][pPackSnack]);
dini_IntSet(file, "HasSnack",AccountInfo[playerid][pHasSnack]);
dini_IntSet(file, "AdminLevel",AccountInfo[playerid][pAdminLevel]);
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Skin", GetPlayerSkin(playerid));
}
#define scriptfiles "/ILSRP/%s.ini"
Password=232129203
HasCondom=0
PackCondom=0
HasCigar=0
HasPack=0
PackSnack=0
AdminLevel=0
PackCigars=0
HasSnack=0
Money=1500
Score=1
Skin=0
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dudb>
#include <gvar>
#include <time>
#include <dprops>
#include <utils>
#include <dini>
#pragma unused ret_memcpy
#pragma unused strtok
format(file, sizeof(file), scriptfiles, name);
//register /login system
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{9ACD32}ILSR - Register{FFFFFF}", "You have joined under a non registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Enter the password you will remember)", "Register", "Quit");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "{9ACD32}ILSRP - Login{FFFFFF}", "{FFFFFF}You have rejoined under a registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Entering a wrong password, gets you IP blocked){FFFFFF}", "Login", "Quit");
}
//
#define scriptfiles "/ILSRP/%s.ini"
public SaveCharacter()
He means if you have any stock/public where you save the data. example:
pawn Код:
|
public SaveCharacter()
stock PlayerInfo(playerid) {
new pname[30], string[40];
GetPlayerName(playerid, pname, 30);
format(string, sizeof string, "%s (%d)", pname, playerid);
return string;
}
stock PlayerCash(playerid, cash)
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) + cash);
return 1;
}
He means if you have any stock/public where you save the data. example:
pawn Код:
|
Oh my god.
Okay, let's try and stoop down to your level. Show everything that has "scriptfiles" in in it. |
#define scriptfiles "/ILSRP/%s.ini"
//register /login system
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{9ACD32}ILSR - Register{FFFFFF}", "You have joined under a non registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Enter the password you will remember)", "Register", "Quit");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "{9ACD32}ILSRP - Login{FFFFFF}", "{FFFFFF}You have rejoined under a registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Entering a wrong password, gets you IP blocked){FFFFFF}", "Login", "Quit");
}
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);
if(!response) return Kick(playerid);
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), scriptfiles, name);