- เครดิต
- 79
- ความรู้
-
- เงิน $
-
- ความดี
-
|
นี้ครับ
public CuTrue(playerid)
{
new query[256];
format(query, sizeof(query), "SELECT refill FROM cutrue WHERE account_id=%d and refill='NO'", PlayerInfo[playerid][pSQLID]);
mysql_query(query);
mysql_store_result();
if (mysql_num_rows()!=0)
{
format(query, sizeof(query), "SELECT SUM(refill_amount) as sumamount FROM cutrue WHERE account_id=%d and refill='NO'", PlayerInfo[playerid][pSQLID]);
mysql_query(query);
new CuTrueRow[256];
new CuTruePoint;
mysql_store_result();
mysql_fetch_row(CuTrueRow);
printf("%s",CuTrueRow);
CuTruePoint = strval(CuTrueRow);
if(CuTruePoint != 0)
{
PlayerInfo[playerid][pPShop] += CuTruePoint; // pPoint เปลี่ยนตามสคริปของคุณนะครับ
CuTruePoint = 0;
MySQLCheckConnection();
format(query, MAX_STRING, "UPDATE players SET ");
MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Point", PlayerInfo[playerid][pPShop]); // Points เปลี่ยนตาม Field / pPoint เปลี่ยนตาม สคริปของคุณนะครับ
MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);
format(query, sizeof(query), "UPDATE cutrue set refill='YES' WHERE account_id=%d", PlayerInfo[playerid][pSQLID]);
mysql_query(query);
}
}
return 1;
} |
|