Skin not saving -
xdarren - 12.10.2013
Hello.
I have a problem my skin is not saving. It works fine with selecting the skin. I choose the skin and it changes it. But when I die or relog the skin resets and puts a random one.
How to save the skin after choosing. I am using this system:
http://gta-sa-mp.de/stuff/mSelection/colorPreview.png
CODE:
Код:
new skinlist = mS_INVALID_LISTID;
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
SendClientMessage(playerid, 0xFF0000FF, "Your has been changed!");
SetPlayerSkin(playerid, modelid);
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
return 1;
}
return 1;
}
public OnGameModeInit()
{
ManualVehicleEngineAndLights();
new FormatForFaction[20];
skinlist = LoadModelSelectionMenu("skins.txt");
return 1;
}
CMD:clothes(playerid, params[])
{
ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
return 1;
}
Re: Skin not saving -
PT - 12.10.2013
you need save them using one save system like y_ini, DOF2, MySQL, SQLite, etc..
Re: Skin not saving -
xdarren - 12.10.2013
I have y_ini but how to use it.
Re: Skin not saving -
PT - 12.10.2013
show me please the variable you use to save the player skin.
Re: Skin not saving -
xdarren - 12.10.2013
I had this code before changing to the new choosing system of clothes.
Код:
COMMAND:clothes(playerid, params[])
{
new tmpid=IsPlayerInBiz(playerid);
if(tmpid!=-1 && biz[tmpid][biztype]==9 && GetPlayerVirtualWorld(playerid)==biz[tmpid][vbiz])
{
GetPlayerPos(playerid, PlayerPosition[playerid][0], PlayerPosition[playerid][1], PlayerPosition[playerid][2]);
PlayerInterior[playerid] = GetPlayerInterior(playerid);
PlayerVirtualWorld[playerid] = GetPlayerVirtualWorld(playerid);
GetPlayerHealth(playerid, PlayerHealth[playerid]);
GetPlayerArmour(playerid, PlayerArmour[playerid]);
for (new i = 0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
}
SetPVarInt(playerid, "SkinSelect", 1);
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0.0);
return 1;
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
if(PLAYERLIST_authed[playerid])
{
if(GetPVarInt(playerid, "SkinSelect") == 1)
{
SetPlayerPos(playerid, 204.2521,-158.8996,1001.5491);
SetPlayerFacingAngle(playerid, 179.28);
SetPlayerInterior(playerid, 14);
SetPlayerCameraPos(playerid, 202.5867,-164.1917,1001.7235);
SetPlayerCameraLookAt(playerid, 204.2521,-158.8996,1001.5491);
}
else
{
//SendClientMessage(playerid,COLOR_RED,"You can't change your skin. Use clothes-shops!");
SetPlayerTeamEx(playerid,PlayerInfo[playerid][playerteam]);
PlayerTemp[playerid][spawnrdy]=0;
}
}
return 1;
}
Re: Skin not saving -
PT - 12.10.2013
no, this don't save, i said the local where, save the skin,
some thing like INI........
Re: Skin not saving -
xdarren - 12.10.2013
dUserSetINT(PlayerName(playerid)).("skin",GetPlaye rSkin(playerid));
PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid);
Re: Skin not saving -
PT - 12.10.2013
now is only chage their this callback
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == skinlist)
{
if(response)
{
SendClientMessage(playerid, 0xFF0000FF, "Your has been changed!");
SetPlayerSkin(playerid, modelid);
dUserSetINT(PlayerName(playerid)).("skin",modelid);
PlayerInfo[playerid][Skin] = modelid;
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled skin selection");
return 1;
}
return 1;
}
Re: Skin not saving -
xdarren - 12.10.2013
ty +rep
Re: Skin not saving -
iFiras - 12.10.2013
Correct this
You wrote this
pawn Код:
SendClientMessage(playerid, 0xFF0000FF, "Your has been changed!");
instead of
pawn Код:
SendClientMessage(playerid, 0xFF0000FF, "Your skin has been changed!");