SA-MP Forums Archive
MySql 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: MySql Skins (/showthread.php?tid=645825)



MySql Skins - mick3 - 04.12.2017

I'm not sure why the skin isn't being assigned. Everything gets assigned from the mysql data except the skin. The skin ID saves to mysql, but I always come back as CJ (Skin ID 0).

Код:
AssignPlayerData(playerid)
{
    cache_get_value_int(0, "ID", Player[playerid][ID]);
 
    cache_get_value_int(0, "Admin", Player[playerid][Admin]);
    cache_get_value_int(0, "Skin", Player[playerid][Skin]);
    cache_get_value_float(0, "Health", Player[playerid][Health]);
    cache_get_value_float(0, "Armor", Player[playerid][Armor]);
    cache_get_value_int(0, "Money", Player[playerid][Money]);
    cache_get_value_int(0, "BankMoney", Player[playerid][BankMoney]);
   
    cache_get_value_float(0, "X", Player[playerid][X_Pos]);
    cache_get_value_float(0, "Y", Player[playerid][Y_Pos]);
    cache_get_value_float(0, "Z", Player[playerid][Z_Pos]);
    cache_get_value_float(0, "Angle", Player[playerid][A_Pos]);
    cache_get_value_int(0, "Interior", Player[playerid][Interior]);
 
    SetMoney(playerid, Player[playerid][Money]);
    SetPlayerSkin(playerid, Player[playerid][Skin]);
    SetHealth(playerid, Player[playerid][Health]);
    SetArmor(playerid, Player[playerid][Armor]);
    return 1;
}
Any ideas? Please and thank you.




EDIT: NEVERMIND IM STUPID.

Those who are having trouble with this as well, go to your SetSpawnInfo. The 3rd parameter was set to "0" for me. I replaced that with Player[playerid][Skin].