Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Mysql save wrong variables - mixing pSpawn and pSkin

$
0
0
In script when I set player Skin for example to: 288 ( PlayerInfo[playerid] = 288; )

And when I save it to mysql base on player disconnect it saves under pSpawn 288 and under pSkin 49 for unknown reason. Here is the code:

PHP Code:

    format(JLstringsizeof(JLstring), "UPDATE `players` SET `Tutorial` = %d, `HoursGameplay` = %d, `LastOnline` = '%e',"PlayerInfo[playerid][pTutorial], PlayerInfo[playerid][pHoursGameplay], PlayerInfo[playerid][pLastOnline]);
    
strcat(stringJLstring);

    
format(JLstringsizeof(JLstring), "`LatestIP` = '%e', `Skin` = %d, `Spawn` = %d, `VirtualWorld` = %d, `Interior` = %d,"PlayerInfo[playerid][pLatestIP], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pVirtualWorld], PlayerInfo[playerid][pInterior]);
    
strcat(stringJLstring);

    
format(JLstringsizeof(JLstring), "`Kills` = %d, `Deaths` = %d, `Hunger` = %d, `Thirst` = %d,"PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pHunger], PlayerInfo[playerid][pThirst]);
    
strcat(stringJLstring);

    
format(JLstringsizeof(JLstring), "`AdminLevel` = %d, `LeaderCoord` = %d, `AdminPin` = %d, `LeaderCoordPin` = %d,"PlayerInfo[playerid][pAdminLevel], PlayerInfo[playerid][pLeaderCoord], PlayerInfo[playerid][pAdminPin], PlayerInfo[playerid][pLeaderCoordPin]);
    
strcat(stringJLstring);

    
format(JLstringsizeof(JLstring), "`Leader` = %d, `LeaderPin` = %d, `Member` = %d, `Rank` = %d, `OrgContract` = %d, `OrgDelivers` = %d, `OrgTasks` = %d,"PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pLeaderPin], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pOrgContract], PlayerInfo[playerid][pOrgDelivers], PlayerInfo[playerid][pOrgTasks]);
    
strcat(stringJLstring);

    
format(JLstringsizeof(JLstring), "`SubOrgLeader` = %d, `SubOrgMember` = %d, `SubOrgRank` = %d, `SubOrgContract` = %d, `SubOrgTasks` = %d, `Roadblock` = %d WHERE `ID` = %d LIMIT 1"PlayerInfo[playerid][pSubOrgLeader], PlayerInfo[playerid][pSubOrgMember], PlayerInfo[playerid][pSubOrgRank], PlayerInfo[playerid][pSubOrgContract], PlayerInfo[playerid][pSubOrgTasks], PlayerInfo[playerid][pRoadblock], PlayerInfo[playerid][pID]);
    
strcat(stringJLstring);


    
mysql_format(DatabaseDB_Querysizeof(DB_Query), string);
    
mysql_tquery(DatabaseDB_Query); 

Sometimes it won't save pSkin also...

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>