SA-MP Forums Archive
Help please. Skin save - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help please. Skin save (/showthread.php?tid=122386)



Help please. Skin save - bartje01 - 21.01.2010

Hey guys.
I'm making a own server. But I really need an /register and /login system that will save score money and skins.
The skins are the most important. Can someone tell me how to get this? Normal register FS doesn't work with saving skins.

Regardsss


Re: Help please. Skin save - akis_tze - 21.01.2010

use dini to save

for save skin recomend use save onplayerdisconect
Code:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);//leader the name of your folder in scriptfiles
if(!dini_Exists(file))
dini_Create(file);
dini_IntSet(file, "skin", GetPlayerSkin(playerid));
for load the skin recomend use load on playerspawn
Code:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
if(dini_Exists(file))
{
SetTimerEx("SpawnSave", 100, false, "d", playerid);
}
and for end you will need that add this in the end of your script
Code:
forward SpawnSave(playerid);
public SpawnSave(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
SetPlayerSkin(playerid, dini_Int(file, "skin"));
return 1;
}



Re: Help please. Skin save - akis_tze - 21.01.2010

and the most importan
Code:
#include <dini>



Re: Help please. Skin save - xkniives - 24.01.2010

Quote:
Originally Posted by [TGCAR
KotZ ]
use dini to save

for save skin recomend use save onplayerdisconect
Code:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);//leader the name of your folder in scriptfiles
if(!dini_Exists(file))
dini_Create(file);
dini_IntSet(file, "skin", GetPlayerSkin(playerid));
for load the skin recomend use load on playerspawn
Code:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
if(dini_Exists(file))
{
SetTimerEx("SpawnSave", 100, false, "d", playerid);
}
and for end you will need that add this in the end of your script
Code:
forward SpawnSave(playerid);
public SpawnSave(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
SetPlayerSkin(playerid, dini_Int(file, "skin"));
return 1;
}
That's too bad that it doesn't work.