Why im not saw it in Users?
#1

Hello Guys i do Register / Login System By ME But i really Dont know When I Register i didn't got a " %s.ini " in Users i put Folder Name Users in scriptfiles But im didn't saw it Why? Can u help me ?

i type

PHP код:
#define PATH "/Users/%s.ini" 
Reply
#2

And? Where's the rest of it?
Reply
#3

Quote:
Originally Posted by Recardo
Посмотреть сообщение
Hello Guys i do Register / Login System By ME But i really Dont know When I Register i didn't got a " %s.ini " in Users i put Folder Name Users in scriptfiles But im didn't saw it Why? Can u help me ?

i type

PHP код:
#define PATH "/Users/%s.ini" 
Show OnPlayerDisconnect callback...
Reply
#4

Oops Sorry i will show u

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;

this


PHP код:
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;

this

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;

Reply
#5

that you mean Right
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)