MySQL Skin saving system.
#2

PHP код:
 enum _PSTATS
{
    
pLayaName[24],
    
pPassword[35],
    
pKills,
    
pDeaths,
    
pMoney,
    
pLevel,
    
pSkin

stock SavePInfo(playerid)
{
    if(
GetPVarInt(playerid"LoggedIN") == 1)
    {        
       
PVar[playerid][pSkin] = GetPlayerSkin(playerid);
       new
            
Query[600];
        
format(Querysizeof(Query), "UPDATE `playerinfo` SET `kills` = %d, `deaths` = %d, `money` = %d, `Level` = %d, `Skin` = %d WHERE `user` = '%s'"// Also remember to update this...
        
PVar[playerid][pKills],
        
PVar[playerid][pDeaths],
        
GetPlayerMoney(playerid),
        
PVar[playerid][pLevel],
        
PVar[playerid][pSkin],
        
pName(playerid));
        
mysql_query(Query);
        
mysql_free_result();
        return 
1;
    }
    else return 
0;
}
stock ResetPVars(playerid)
{
    
PVar[playerid][pLevel]         = 0;
    
PVar[playerid][pKills]         = 0;
    
PVar[playerid][pDeaths]     = 0;
    
PVar[playerid][pMoney]         = 0;
    
PVar[playerid][pSkin]         = 0;

That should be correct.

By the way, if you're new to MySQL, you should really upgrade to the latest.
Reply


Messages In This Thread
MySQL Skin saving system. - by sscarface - 29.05.2015, 23:48
Re: MySQL Skin saving system. - by J0sh... - 29.05.2015, 23:57
Re: MySQL Skin saving system. - by sscarface - 30.05.2015, 00:23
Re: MySQL Skin saving system. - by sscarface - 30.05.2015, 00:40
Re: MySQL Skin saving system. - by BroZeus - 30.05.2015, 05:36

Forum Jump:


Users browsing this thread: 2 Guest(s)