18.01.2015, 19:38
So i used a timer to save skin but it spawns it as 0 when i relog...
my timer..
onplayerconnect
onplayerspawn
It spawns but sets as skin id 0.
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;
}
pawn Код:
skinsaving[playerid] = SetTimerEx("SkinSaving", 600000,1,"i",playerid);
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);}

