I cant save custom skins - 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: I cant save custom skins (
/showthread.php?tid=653811)
I cant save custom skins -
dani18 - 13.05.2018
Can somehow save my custom skin in the database in SQL? Because i can not.
I have skins in textdraws, and i use this code to save the skins or at least update them in the database.
PHP код:
new x=0;
while(x != SELECTION_ITEMS)
{
if(playertextid == gSelectionItems[playerid][x])
{
if(gSelectionItemsTag[playerid][x] >= 25001 && gSelectionItemsTag[playerid][x] < 25005)
SetPlayerSkin(playerid, gSelectionItemsTag[playerid][x]);
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
DestroySelectionMenu(playerid);
CancelSelectTextDraw(playerid);
SkinChangeer[playerid] = 0;
SkinUse[playerid] = GetPlayerSkinEx(playerid);
Saveaccount(playerid);
return 1;
}
x++;
}
PD: The "GetPlayerSkinEx" i used from the RogueDrifter include.
And here where all the data is saved and updated.
PHP код:
GuardarCuenta(playerid)
{
new str[64];
format(string, sizeof(string), "");
strcat(cadena, "UPDATE PLAYERS SET ");
format(str, 64, "skin = '%d'", GetPlayerSkinEx(playerid)); strcat(string, str);
format(str, 64, " WHERE name= '%s'", DB_Escape(PlayerName(playerid))); strcat(string, str);
db_query(Database, string);
return 1;
}
Re: I cant save custom skins -
dani18 - 13.05.2018
fixed.