28.06.2012, 15:16
pawn Код:
enum PlayerInfo
{
Skin //User's Skin
}
pawn Код:
public loadaccount_user(playerid, name[], value[])
{
INI_Int("Skin",pInfo[playerid][Skin]);//Get Player Skin
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(fexist(Path(playerid)))
{
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteInt(file,"Skin",pInfo[playerid][Skin]);// To save skin and all other things
INI_Close(file);
return 1;
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dregister)
{//After successful Register
INI_WriteInt(file,"Skin",0);//Save Skin
return 1;
}
if(dialogid == dlogin)
{//After successful Login
SetPlayerSkin(playerid,pInfo[playerid][Skin]);
}
}
pawn Код:
//Code after you select skin
pInfo[playerid][Skin] = GetPlayerSkin(playerd);