Y_INI problem!!
#1

pawn Код:
if(dialogid == DIALOG_REGISTER)
    {
        if (!response) return Kick(playerid);
        if(response)
        {
            new string[128], string2[128];
            if(!strlen(inputtext)) return
            format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
            format(string2, sizeof(string2), "Error! Cannot create your account.\n\n%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
            ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
            new INI:File = INI_Open(UserSavePath(playerid));
            INI_SetTag(File,"data");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
            INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
            INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills] = 0);
            INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths] = 0);
            INI_WriteInt(File, "Ban",PlayerInfo[playerid][pBan] = 0);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have just registered, welcome to "GM_NAME"!");
            SpawnPlayer(playerid);
        }
    }
It will create the file in the User folder, I get no errors or warnings, it creates it but theres no data inside it, any help?
Reply
#2

INI_Close(File); ?
Reply
#3

Still didn't fix it ;/
Reply
#4

Hmm.. you don't need "PlayerInfo[playerid][****] = 0". Just remove PlayerInfo[playerid][*****] =
So it should be like
INI_WriteInt(File, "something",0);
Reply
#5

Didnt work either :/
Reply
#6

Try this.

PHP код:
if(dialogid == DIALOG_REGISTER)
{
    if(!
response) return Kick(playerid);
    if(
response)
    {
        new 
string[128], string2[128];
        if(!
strlen(inputtext))
        {
            
format(stringsizeof(string), ""GM_NAME" Registration: (%s)"GetPlayerNameEx(playerid));
            
format(string2sizeof(string2), "Error! Cannot create your account.\n\n%s, we cannot find this name registered in the database!\nPlease enter a password to register."GetPlayerNameEx(playerid));
            
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUTstringstring2"Register""Close");
        }
        new 
INI:File INI_Open(UserSavePath(playerid));
        
INI_SetTag(File,"data");
        
INI_WriteInt(File,"Password",udb_hash(inputtext));
        
INI_WriteInt(File"Level",0);
        
INI_WriteInt(File"Admin",0);
           
INI_WriteInt(File"Level",0);
        
INI_WriteInt(File"Admin",0);
        
INI_WriteInt(File"Kills",0);
           
INI_WriteInt(File"Deaths",0);
        
INI_WriteInt(File"Ban",0);
        
INI_Close(File);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have just registered, welcome to "GM_NAME"!");
        
SpawnPlayer(playerid);
    }

If you still have a problem, show me your UserSavePath(playerid)
Reply
#7

pawn Код:
stock UserSavePath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string), USERPATH, playername);
    return string;
}
Still didn't work
Reply
#8

look, this is direct from my server, it works.

PHP код:
new pname[MAX_PLAYER_NAME];
    new 
string[256];
    new 
string2[256];
    new 
id;
    new 
Float:health;
    new 
WantedLevel GetPlayerWantedLevel(playerid);
    switch(
dialogid)
    {
     switch(
dialogid)
     {
        case 
DIALOG_REGISTER:
        {
            if (!
response)
            {
               return 
1;
            }
            if(
response)
            {
                
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash] +1000000);
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"Player's Data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteInt(File,"AdminLevel",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Banned",0);
                
INI_Close(File);
            }
        }
     }
     switch(
dialogid)
     {
        case 
DIALOG_LOGIN:
        {
            if (!
response)
            {
               return 
1;
            }
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,"{F81414}","{FFFFFF}You have entered an incorrect password.\nPlease type your password below to login.\n\n{F81414}Please relog with a different username if that's not your account.","Login","Quit");
                }
                return 
1;
            }
        }
    } 
Reply
#9

^ Didnt work

IDK but yini or anything never saves on my computer but on my VPS it does, and thats like windows 2003 and mines windows 7
Reply
#10

Run the server console as an Admin?

Or have Admin rights on your PC.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)