Skin not saving
#7

So i used a timer to save skin but it spawns it as 0 when i relog...
my timer..

pawn Код:
function SkinSaving(playerid)
{
    pinfo[playerid][Skin] = GetPlayerSkin(playerid);
    mysql_format(MySQLTunnel,Query,sizeof(Query),"UPDATE `accounts` SET `pskin` = '%d' WHERE `pid` = '%d'",pinfo[playerid][Skin],pinfo[playerid][pMySQLID]);
    mysql_pquery(MySQLTunnel,Query);
    return 1;
}
onplayerconnect
pawn Код:
skinsaving[playerid] = SetTimerEx("SkinSaving", 600000,1,"i",playerid);
onplayerspawn
pawn Код:
if((pinfo[playerid][pLogged] == 1)) {
        mysql_format(MySQLTunnel, Query, sizeof(Query), "SELECT `pskin` FROM `accounts` WHERE `pid` = '%d'", pinfo[playerid][pMySQLID]);
        new Cache:result = mysql_query(MySQLTunnel, Query);
        if(cache_get_row_count() != 0)
        {
            pinfo[playerid][Skin] = cache_get_field_content_int(0, "pskin");
            SetPlayerSkin(playerid,pinfo[playerid][Skin]);
        }
        cache_delete(result);}
It spawns but sets as skin id 0.
Reply


Messages In This Thread
Skin not saving - by vassilis - 18.01.2015, 17:59
Re: Skin not saving - by Ironboy - 18.01.2015, 18:07
Re: Skin not saving - by vassilis - 18.01.2015, 18:14
Re: Skin not saving - by Ironboy - 18.01.2015, 18:20
Re: Skin not saving - by vassilis - 18.01.2015, 18:26
Re: Skin not saving - by Ironboy - 18.01.2015, 18:32
Re: Skin not saving - by vassilis - 18.01.2015, 19:38

Forum Jump:


Users browsing this thread: 1 Guest(s)