If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
Recardo - 19.05.2016
Why i Can't saw my Nickname in Users File ? i already Make a Users Folder in scriptfiles but dosn't work Why? Show this
PHP код:
#define PATH "/Users/%s.ini"
#define UserPath "Users/%s.ini"
Are u saw ? i put it I'll show u the onplayerconnect and many Saw
PHP код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), "scriptfiles/Users/%s.ini", name);
if(!fexist(file)) {
SendClientMessage(playerid, COLOR_YELLOW, "You are not registered, please register");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please Register", "Enter Your Password Below", "Register", "Cancel");
}
else {
new str[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "Welcome Back {FF0000}%s. Enjoy!", name);
SendClientMessage(playerid, COLOR_YELLOW, str);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), "scriptfiles/Users/%s.ini", name);
if(dini_Exists(file)) {
dini_IntSet(file, "pw", PlayerInfo[playerid][pw]);
dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
dini_IntSet(file, "level", PlayerInfo[playerid][level]);
}
return 1;
}
Tell me What HAppend
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) {
new file[128], name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), "scriptfiles/Users/%s.ini", name);
if(response) {
if(strlen(inputtext)) {
dini_Create(file);
dini_IntSet(file, "pw", num_hash(inputtext));
dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
dini_IntSet(file, "level", PlayerInfo[playerid][level]);
format(str, sizeof(str), "You are registered as {FF0000}%s. Your password is {00FF00}%s.", name, inputtext);
SendClientMessage(playerid, COLOR_YELLOW, str);
PlayerInfo[playerid][level] = dini_Int(file, "level");
PlayerInfo[playerid][cash] = dini_Int(file, "cash");
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
}
}
else {
Kick(playerid);
}
}
if(dialogid == 2) {
new file[128], name[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "scriptfiles/Users/%s.ini", name);
if(response) {
if(strlen(inputtext)) {
if(num_hash(inputtext) != dini_Int(file, "pw")) {
SendClientMessage(playerid, COLOR_BLUE, "Wrong Password");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
}
else {
SendClientMessage(playerid, COLOR_GREEN, "Succesfuly logged in");
PlayerInfo[playerid][level] = dini_Int(file, "level");
PlayerInfo[playerid][cash] = dini_Int(file, "cash");
GivePlayerMoney(playerid, dini_Int(file, "cash"));
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
}
}
}
else {
Kick(playerid);
}
}
return 1;
}
i didn't got any Error / Warring but when i go my Server and Register And When i Relog i need Register Again Why !! Why ? i want Login When Register! That Happend! And i didn't saw my Username in File " USERS "
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
oMa37 - 19.05.2016
Why u have to make 2 threads? you already made one about the same problem, be patient and you will get the solution.
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
Luicy. - 19.05.2016
Remove scriptfiles from "scriptfiles/Users/%s.ini"
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
Recardo - 19.05.2016
i did still not work
sorry for 2 thread
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
Recardo - 19.05.2016
What did i can to fix itttt
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
ilijap - 19.05.2016
Why are you using dini? O,o
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
Recardo - 19.05.2016
For file? Users
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
oMa37 - 19.05.2016
I recommend you to use y_ini instead, or mysql, but y_ini is easier to use than them both.
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
ilijap - 19.05.2016
mysql is easier
Re: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] -
BlackbirdXd - 19.05.2016
If You can't find an Problem of Your Solution Then you can Install Lux Admin for your gamemode, it would be perfect and saves your Nick name stats other others As Well.