13.05.2018, 14:34
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.
PD: The "GetPlayerSkinEx" i used from the RogueDrifter include.
And here where all the data is saved and updated.
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++;
}
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;
}