Bring player on last skin he selected
#2

For save the skin, you should put this code under OnPlayerDisconnect :

PHP код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(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 Loading your skin, put this code under OnPlayerSpawn :

PHP код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(file), "\\Leaders\\%s.ini"pname);
if(
dini_Exists(file))
{
SetTimerEx("SpawnSave"100false"d"playerid);

At the end :

PHP код:
forward SpawnSave(playerid);
public 
SpawnSave(playerid)
{
new 
file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(file), "\\Leaders\\%s.ini"pname);
SetPlayerSkin(playeriddini_Int(file"skin"));
return 
1;

And don't forget to include dini at the top of your scripts :

PHP код:
#include <dini> 
Hope it helps,

KillerDVX,
Reply


Messages In This Thread
Bring player on last skin he selected - by sheNdjze - 24.06.2015, 03:22
Re : Bring player on last skin he selected - by KillerDVX - 24.06.2015, 03:30
Re: Bring player on last skin he selected - by sheNdjze - 24.06.2015, 03:50
Re : Bring player on last skin he selected - by KillerDVX - 24.06.2015, 03:59
Re: Bring player on last skin he selected - by sheNdjze - 24.06.2015, 04:06
Re: Bring player on last skin he selected - by sheNdjze - 24.06.2015, 04:21
Re : Bring player on last skin he selected - by KillerDVX - 24.06.2015, 04:30
Re: Bring player on last skin he selected - by sheNdjze - 24.06.2015, 04:40
Re: Re : Bring player on last skin he selected - by Sithis - 24.06.2015, 05:19
Re: Bring player on last skin he selected - by sheNdjze - 24.06.2015, 06:02

Forum Jump:


Users browsing this thread: 2 Guest(s)