Report bug
#1

, so, when I type /re something to report

It saves in mysql but it doesn't show that I sent the report / it doesn't show for admins that report was received.

Also I can spam with /re

Errors mentioned above applies for /report too


PHP код:
forward OnPlayerReport(playeridtargetidreason);
public 
OnPlayerReport(playeridtargetidreason)
{
    new 
rowsfields;
    
cache_get_data(rowsfieldshandle);
    new  
reportid;
    new 
count cache_num_rows();
    if(
count 0)
    {
        new 
reportstring[250],reportstring2[250];
           
reportid cache_get_field_content_int(0"ID"handle);
        
format(reportstring2,sizeof(reportstring2), ""chat""COL_YELLOW"[REF:#%d]: Your report upon %s(%d) has been sent "COL_WHITE" (Reason: %s)",reportidPlayerName(targetid),targetidreason);
        
SendClientMessage(playerid,-1,reportstring2);
        
format(reportstring,sizeof(reportstring), ""chat""COL_YELLOW"[REF:#%d]: Player %s(ID:%d) has reported %s(ID:%d)"COL_WHITE" (Reason: %s)",reportidPlayerName(playerid),playerid,PlayerName(targetid),targetid,reason);
        
SendMessageToAllAdmins(reportstring,-1);
          
pInfo[playerid][pReported] = 1;
          
timeras[playerid] = SetTimerEx("Report"600000"i"playerid);
    }
}
forward OnPlayerReporte(playeridreason);
public 
OnPlayerReporte(playeridreason)
{
    new 
rowsfields;
    
cache_get_data(rowsfieldshandle);
    new  
reportid;
    new 
count cache_num_rows();
    if(
count 0)
    {
        new 
reportstring[250],reportstring2[250];
           
reportid cache_get_field_content_int(0"ID"handle);
        
format(reportstring2,sizeof(reportstring2), ""chat""COL_YELLOW"[REF:#%d]: Your report was sent. "COL_WHITE" Title: [%s].",reportidreason);
        
SendClientMessage(playerid,-1,reportstring2);
        
format(reportstring,sizeof(reportstring), ""chat""COL_YELLOW"[REF:#%d]: Player %s(ID:%d) has reported an error. "COL_WHITE" (Title: %s)",reportidPlayerName(playerid),playerid,reason);
        
SendMessageToAllAdmins(reportstring,-1);
          
pInfo[playerid][pReported] = 1;
          
timeras[playerid] = SetTimerEx("Report"600000"i"playerid);
    }


PHP код:
CMD:report(playerid,params[])
{
    new 
targetid,reason[250];
    if(
sscanf(params"us[105]"targetid,reason)) return SendClientMessage(playerid,-1,""chat" /report [playerid] [Reason]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"Not online");
     if(
targetid == playerid) return SendClientMessage(playerid,-1""COL_RED"EROARE:  Can report yourself.");
    if(!
IsPlayerNPC(targetid))
    {
        if(
pInfo[playerid][pReported] == 0)
        {
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#reportlog"` (Username, Targetname, Report, Data) VALUES ('%s', '%s', '%s', CURRENT_TIMESTAMP)",PlayerName(playerid),PlayerName(targetid), reason);
            
mysql_tquery(handlejQuery"""");
            
mysql_tquery(handle"SELECT * FROM `reportlog` ORDER BY ID DESC LIMIT 1""OnPlayerReport""uus[80]"playeridtargetidreason);
        }
        else {
            
SendClientMessage(playerid,-1,""COL_RED"Wait 1 minute");
        }
    }
    else return 
SendClientMessage(playerid,-1,""COL_RED"can't report npc !");
    return 
1;
}
CMD:re(playerid,params[])
{
        new 
reason[250];
        if(
sscanf(params"s[80]",reason)) return SendClientMessage(playerid,-1,""chat" /(re)port [Reason]");
        if(
pInfo[playerid][pReported] == 0)
        {
            
format(jQueryMAX_QUERY_LENGTH"INSERT INTO `"#reportlog"` (Username, Report, Data) VALUES ('%s', '%s', CURRENT_TIMESTAMP)",PlayerName(playerid), reason);
            
mysql_tquery(handlejQuery"""");
            
mysql_tquery(handle"SELECT * FROM `reportlog` ORDER BY ID DESC LIMIT 1""OnPlayerReporte""s[80]"playeridreason);
        }
        else {
            
SendClientMessage(playerid,-1,""COL_RED"Wait one minute");
        }
        return 
1;

Reply


Messages In This Thread
Report bug - by Zeus666 - 21.10.2018, 22:05
Re: Report bug - by v1k1nG - 21.10.2018, 22:48
Re: Report bug - by Zeus666 - 21.10.2018, 22:51
Re: Report bug - by Jefff - 21.10.2018, 23:11
Re: Report bug - by Chyakka - 21.10.2018, 23:15
Re: Report bug - by Zeus666 - 21.10.2018, 23:30
Re: Report bug - by Zeus666 - 21.10.2018, 23:53
Re: Report bug - by Zeus666 - 22.10.2018, 09:09
Re: Report bug - by Calisthenics - 22.10.2018, 09:56
Re: Report bug - by Zeus666 - 22.10.2018, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)