Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward GetReportCount(userid, tdate[]);
- public GetReportCount(userid, tdate[])
- {
- new string[128];
- format(string, sizeof(string), "SELECT SUM(count) as totalcount FROM `tokens_report` WHERE `playerid` = %d AND `date` = '%s'", GetPlayerSQLId(userid), tdate);
- return mysql_tquery(MainPipeline, string, "QueryGetCountFinish", "ii", userid, 0);
- }
- forward GetHourReportCount(userid, thour[], tdate[]);
- public GetHourReportCount(userid, thour[], tdate[])
- {
- new string[128];
- format(string, sizeof(string), "SELECT `count` FROM `tokens_report` WHERE `playerid` = %d AND `date` = '%s' AND `hour` = '%s'", GetPlayerSQLId(userid), tdate, thour);
- return mysql_tquery(MainPipeline, string, "QueryGetCountFinish", "ii", userid, 1);
- }
- forward GetRequestCount(userid, tdate[]);
- public GetRequestCount(userid, tdate[])
- {
- new string[128];
- format(string, sizeof(string), "SELECT SUM(count) as totalcount FROM `tokens_request` WHERE `playerid` = %d AND `date` = '%s'", GetPlayerSQLId(userid), tdate);
- return mysql_tquery(MainPipeline, string, "QueryGetCountFinish", "ii", userid, 0);
- }
- forward GetHourRequestCount(userid, thour[], tdate[]);
- public GetHourRequestCount(userid, thour[], tdate[])
- {
- new string[128];
- format(string, sizeof(string), "SELECT `count` FROM `tokens_request` WHERE `playerid` = %d AND `date` = '%s' AND `hour` = '%s'", GetPlayerSQLId(userid), tdate, thour);
- return mysql_tquery(MainPipeline, string, "QueryGetCountFinish", "ii", userid, 1);
- }
- forward QueryGetCountFinish(userid, type);
- public QueryGetCountFinish(userid, type)
- {
- new rows = cache_num_rows();
- switch(type)
- {
- case 0:
- {
- if(rows > 0)
- {
- new bool:is_null;
- cache_is_value_name_null(o, "totalcount", is_null);
- if(!is_null) {
- cache_get_value_name_int(0, "totalcount", ReportCount[userid]);
- }
- else ReportCount[userid] = 0;
- }
- else ReportCount[userid] = 0;
- }
- case 1:
- {
- if(rows > 0)
- {
- cache_get_value_name_int(0, "count", ReportHourCount[userid]);
- }
- else ReportHourCount[userid] = 0;
- }
- case 2:
- {
- Homes[userid] = rows;
- }
- }
- print("test getcountfinish");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment