Y_INI output - 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: Y_INI output (
/showthread.php?tid=565921)
Y_INI output -
TazmaNiax - 02.03.2015
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...
Re: Y_INI output -
MikE1990 - 02.03.2015
Where you load data from file ? Do you use INI_SetTag ??
Re: Y_INI output -
TazmaNiax - 02.03.2015
Код:
public loadaccount_user(playerid, name[], value[])
{
//... Another Code
INI_Int("Skin",pInfo[playerid][pSkin]);
return 1;
}
Re: Y_INI output -
MikE1990 - 02.03.2015
Can you show player file ?
Re: Y_INI output -
TazmaNiax - 02.03.2015
Quote:
Originally Posted by MikE1990
Can you show player file ?
|
Did u mean userfiles in scriptfiles?
Код:
[DATA]
...
Death = 0
Kills = 0
Skin = -1
Respuesta: Y_INI output -
JuanStone - 02.03.2015
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;
}