Report System
#2

PHP код:
CMD:report(playerid,params[])
{
    new 
reason[60],pid,Query[120],date,month,year;
    
getdate(year,month,date);
    new 
ReportDate getdate();
    if(
sscanf(params,"us[60]",pid,reason)) return SendClientMessage(playerid,COLOR_RED," SERVER : /report [id] [ reason ]");
    if(
pid == INVALID_PLAYER_ID || !IsPlayerConnected(pid)) return ErrorMessages(playerid,2);
    
SendFM(playerid,COLOR_LIGHTRED,"You have reported player %s(%d) Reason: %s",GPN(pid),pid,reason);
    
mysql_format(mysqlQuerysizeof(Query), "INSERT INTO `reports` (`Name`, `Reason`, `Date`) VALUES ('%s', '%s', '%s')",GPN(pid),reason,GPN(playerid),ReportDate);
    
mysql_tquery(mysql,Query);
    
printf(Query);
    foreach(new 
iPlayer)
    {
        if(
pinfo[i][Admin] >= 1)
        
SendFM(i,COLOR_WHITE,""COL_RED"PLAYER"COL_WHITE": %s(%d) "COL_RED"REPORTED"COL_WHITE":%s(%d) "COL_RED"REASON"COL_WHITE":%s(%d)",GPN(playerid),playerid,GPN(pid),pid,reason);
    }
    return 
1;
    

make date value to %s, can you tell me which mysql version are you using?
Reply


Messages In This Thread
Report System - by vassilis - 12.11.2015, 09:07
Re: Report System - by jlalt - 12.11.2015, 09:12
Re: Report System - by vassilis - 12.11.2015, 09:16
Re: Report System - by jlalt - 12.11.2015, 09:38
Re: Report System - by vassilis - 12.11.2015, 09:45
Re: Report System - by jlalt - 12.11.2015, 10:00
Re: Report System - by vassilis - 12.11.2015, 10:10
Re: Report System - by jlalt - 12.11.2015, 11:04
Re: Report System - by vassilis - 12.11.2015, 11:22
Re: Report System - by jlalt - 12.11.2015, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)