[Ajuda] Armazenar SOS
#6

PHP код:
#include <a_samp>
#include <zcmd>
#define MAX_REPORTS (25)
enum reportData {
    
reportExists,
    
reportPlayer,
    
reportText[128]
};
new 
Report[MAX_REPORTS][reportData];
public 
OnFilterScriptInit()
{
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
stock ReportAdd(playeridtext[])
{
    new 
reportid GetFreeReportID();
    
    if (
reportid != -1)
    {
        
Report[reportid][reportExists] = true;
        
Report[reportid][reportPlayer] = playerid;
        
format(Report[reportid][reportText], 128text);
        return 
reportid;
    }
    return -
1;
}
stock GetFreeReportID()
{
    for (new 
0!= MAX_REPORTS++) if (!Report[i][reportExists])
        return 
i;
        
    return -
1;
}
CMD:report(playeridparams[])
{
    new 
reportid ReportAdd(playeridparams);
    if (
reportid != -1)
    {
        for (new 
0MAX_PLAYERS++) if (IsPlayerAdmin(i)) {
            
SendClientMessage(i, -1"Foi recebido um relatуrio.");
        }
        
SendClientMessage(playerid, -1"Seu relatуrio foi enviado para todos os administradores on-line.");
    }
    else {
        
SendClientMessage(playerid, -1"A lista de relatуrios estб cheia. Por favor, espere um pouco.");
    }
    return 
1;
}
CMD:reports(playeridparams[])
{
    new 
countstring[128];
    
    if (!
IsPlayerAdmin(playerid))
        return 
0;
    for (new 
0!= MAX_REPORTS++) if (Report[i][reportExists])
    {
        
format(stringsizeof(string), "%i - %s [%i] relatou: %s"iGetName(Report[i][reportPlayer]), Report[i][reportPlayer], Report[i][reportText]);
        
SendClientMessage(playerid, -1string);
        
        
count++;
    }
    if (!
count)
        return 
SendClientMessage(playerid, -1"Nгo hб relatуrios ativos a serem exibidos.");
        
    return 
1;
}
stock GetName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
     
GetPlayerName(playeridnamesizeof(name));
     return 
name;
}
CMD:ar(playeridparams[])
{
    new 
reportid strval(params), string[128];
        
    if (!
IsPlayerAdmin(playerid))
        return 
0;
    
format(stringsizeof(string), "%s aceitou o seu relatуrio."GetName(playerid));
    
SendClientMessage(Report[reportid][reportPlayer], -1string);
    
Report[reportid][reportExists] = false;
    
Report[reportid][reportPlayer] = INVALID_PLAYER_ID;
    
Report[reportid][reportText] = '\0';
    return 
1;

Reply


Messages In This Thread
Armazenar SOS - by ThuuGLif3 - 08.02.2017, 14:27
Respuesta: Armazenar SOS - by SammyJ - 08.02.2017, 15:37
Re: Armazenar SOS - by ThuuGLif3 - 08.02.2017, 16:47
Re: Armazenar SOS - by ipsLuan - 08.02.2017, 17:46
Re: Armazenar SOS - by ThuuGLif3 - 08.02.2017, 18:43
Re: Armazenar SOS - by 1sbedx - 08.02.2017, 19:02
Re: Armazenar SOS - by ThuuGLif3 - 08.02.2017, 20:18
Re: Armazenar SOS - by 1sbedx - 08.02.2017, 20:34
Re: Armazenar SOS - by ipsLuan - 08.02.2017, 20:44
Re: Armazenar SOS - by lucas_mdr1235 - 08.02.2017, 22:05

Forum Jump:


Users browsing this thread: 2 Guest(s)