SA-MP Forums Archive
If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: If u can help me ! [CANT SHOW MY USERNAME IN USERS FOLDER] (/showthread.php?tid=607433)



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(playeridnameMAX_PLAYER_NAME);
    
format(filesizeof(file), "scriptfiles/Users/%s.ini"name);
    if(!
fexist(file)) {
        
SendClientMessage(playeridCOLOR_YELLOW"You are not registered, please register");
        
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Please Register""Enter Your Password Below""Register""Cancel");
    }
    else {
        new 
str[128];
        
GetPlayerName(playeridnameMAX_PLAYER_NAME);
        
format(strsizeof(str), "Welcome Back {FF0000}%s. Enjoy!"name);
        
SendClientMessage(playeridCOLOR_YELLOWstr);
        
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Please Login""Enter Your Password Below""Login""Cancel");
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[128], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    
format(filesizeof(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(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 1) {
        new 
file[128], name[MAX_PLAYER_NAME], str[128];
        
GetPlayerName(playeridnameMAX_PLAYER_NAME);
        
format(filesizeof(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(strsizeof(str), "You are registered as {FF0000}%s. Your password is {00FF00}%s."nameinputtext);
                
SendClientMessage(playeridCOLOR_YELLOWstr);
                
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(playeridnameMAX_PLAYER_NAME);
        
format(strsizeof(str), "scriptfiles/Users/%s.ini"name);
        if(
response) {
            if(
strlen(inputtext)) {
                if(
num_hash(inputtext) != dini_Int(file"pw")) {
                    
SendClientMessage(playeridCOLOR_BLUE"Wrong Password");
                    
ShowPlayerDialog(playerid2DIALOG_STYLE_INPUT"Please Login""Enter Your Password Below""Login""Cancel");
                }
                else {
                    
SendClientMessage(playeridCOLOR_GREEN"Succesfuly logged in");
                    
PlayerInfo[playerid][level] = dini_Int(file"level");
                    
PlayerInfo[playerid][cash] = dini_Int(file"cash");
                    
GivePlayerMoney(playeriddini_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.