Mysql, CJ SKIN
#4

PHP код:
enum pdata //players' data
{
    
IDD,
    
Name[24],
        
Money,
    
Skin,

PHP код:
stock SaveStats(playerid)
{
    if(
LoggedIn[playerid] == 1)
    {
        new 
SessionTime gettime() - Connected[playerid]; //calculate their current session length
        
        
pData[playerid][Money] = GetPlayerMoney(playerid);
         
pData[playerid][Score] = GetPlayerScore(playerid);
         
mysql_format(chquerysizeof(query),
          
"UPDATE `players` SET ip='%s', level=%d, colour=%d, onlinetime=%d, score=%d, money=%d WHERE id=%d",
            
pData[playerid][IP], pData[playerid][Level], pData[playerid][Colour], pData[playerid][OnlineTime] + SessionTime,
             
pData[playerid][Score], pData[playerid][Money], pData[playerid][IDD]);
        switch(
Disconnecting[playerid])
        {
            case 
0mysql_pquery(chquery);
            case 
1mysql_pquery(chquery"OnStatsSave""i"playerid);
            default: 
mysql_pquery(chquery);
        }
    }
    return 
1;


PHP код:
forward OnStatsSave(playerid);
public 
OnStatsSave(playerid)
{
    
pData[playerid][IDD] = 0;
    
format(pData[playerid][Name], 24"");
    
format(pData[playerid][IP], 16"");
    
pData[playerid][Level] = 0;
    
pData[playerid][Money] = 0;
       
pData[playerid][Skin] = 0
Reply


Messages In This Thread
Mysql, CJ SKIN - by sscarface - 08.06.2015, 02:52
Re: Mysql, CJ SKIN - by sscarface - 08.06.2015, 03:46
Re: Mysql, CJ SKIN - by SoFahim - 08.06.2015, 04:04
Re: Mysql, CJ SKIN - by sscarface - 08.06.2015, 04:19
Re: Mysql, CJ SKIN - by sscarface - 08.06.2015, 05:17
Re: Mysql, CJ SKIN - by SoFahim - 08.06.2015, 05:32
Re: Mysql, CJ SKIN - by sscarface - 08.06.2015, 11:34
Re: Mysql, CJ SKIN - by JaydenJason - 08.06.2015, 12:08
Re: Mysql, CJ SKIN - by sscarface - 09.06.2015, 01:06
Re: Mysql, CJ SKIN - by sscarface - 09.06.2015, 01:18

Forum Jump:


Users browsing this thread: 2 Guest(s)