[Ajuda] Sistema de Boletim de Ocorrкncia dando erros
#7

No seu caso creio eu que ABroadCast vai enviar a mensagem aos admins... crie para mandar a mensagem para os Cops

pawn Код:
forward MensagemPraCOP(COLOR, const string[]);
public MensagemPraCOP(COLOR, const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsACop(i))
            {
                SendClientMessage(i, COLOR, string);
            }
        }
    }
    return 1;
}
//Crie a pasta Logs em Scriptfiles com L maiusculo caso nгo existir...

forward BOLog(string[]);
public BOLog(string[])
{
    new entry[128];
    format(entry, sizeof(entry), "%s\n",string);
    new File:hFile;
    hFile = fopen("Logs/BOLog.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}

// OnPlayerCommandText
    if(strcmp(cmd, "/boletimocorrencia", true) == 0 || strcmp(cmd, "/bo", true) == 0)
    {
        if (!PlayerToPoint(3.0, playerid, 253.9280,69.6094,1003.6406) && !PlayerToPoint(3.0, playerid, 259.2474,120.3977,1003.2188) && !PlayerToPoint(3.0, playerid, 198.9671,168.1982,1003.0234) && !PlayerToPoint(3.0, playerid, 234.8419,111.2194,1003.2257) && !PlayerToPoint(3.0, playerid, 326.8282,304.4166,999.1484) && !PlayerToPoint(3.0, playerid, 699.6252,-553.2016,-3.5950))
        {
            SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo estб na recepзгo de nenhuma DP!");
            return true;
        }
        else
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /crime [Breve Descriзгo]");
                return 1;
            }
            format(string, sizeof(string), "--> Boletim de Ocorrкncia de %s(%d): %s -->", PlayerName(playerid), playerid, (result));
            MensagemPraCOP(0xFFFF66FF, string);
            format(string, sizeof(string), "Boletim de ocorrкncia de %s: %s", PlayerName(playerid), (result));
            BOLog(string);
            SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado com sucesso aos COPs, aguarde por uma resposta...");
            }
        }
        return 1;
    }
obs: fiz o log com base num gm q tinha aki que axo q й parecido com o seu....

xau
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)