Y_INI output
#1

hi, sorry for my bad english b4 xD

i want to ask, i have a problem with saving skins... when it save skin the output of tag "Skins" is -1

Код:
// OnDialogResponse -- Dialog Register

INI_WriteInt(file,"Kills",0);
INI_WriteInt(file,"Deaths",0);
INI_WriteInt(file,"Skins",pInfo[playerid][pSkin]);
INI_Close(file);

public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid, pInfo[playerid][pSkin]);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
INI_WriteInt(file"Skins", GetPlayerSkin(playerid));
}

CMD:skin(playerid, params[])
{
    .... //my code
    ....
    SetPlayerSkin(playerid, skin);
    pInfo[playerid][pSkin] = skin);
    return 1;
}
then when player login, they skin not are saved skin...
Reply
#2

Where you load data from file ? Do you use INI_SetTag ??
Reply
#3

Код:
public loadaccount_user(playerid, name[], value[])
{
    //... Another Code
    INI_Int("Skin",pInfo[playerid][pSkin]);
    return 1;
}
Reply
#4

Can you show player file ?
Reply
#5

Quote:
Originally Posted by MikE1990
Посмотреть сообщение
Can you show player file ?
Did u mean userfiles in scriptfiles?
Код:
[DATA]
...
Death = 0
Kills = 0
Skin = -1
Reply
#6

Show all the code.

pawn Код:
#include <a_samp>
#include <YSI\y_ini>
#include <YSI\y_dialog>
#include <YSI\y_inline>

static skin[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    if(fexist(FolderSkins(playerid)))
    {
        inline loadskin(string:name[], string:value[])
        {
            INI_Int("skin", skin[playerid]);
        }
        INI_ParseFile(FolderSkins(playerid), "loadskin");
    }
    return true;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(FolderSkins(playerid));
    INI_SetTag(File, "Information");
    INI_WriteInt(File, "skin", GetPlayerSkin(playerid));
    INI_Close(File);
   
    return true;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, skin[playerid]);
    return true;
}

FolderSkins(playerid)
{
    new string[65], name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "/skins/%s.ini", name);
    return string;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)