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

Nгo sabia como fazer o comando, entгo peguei fragmentos do comando /relatorio, e tentei montar o comando, acabou dando estes erros, que por sinal, alguns nгo tem nada a ver com o comando, e nгo haviam antes. Cуdigo:

pawn Код:
if(strcmp(cmd,"/boletimocorrencia",true)==0) || if(strcmd(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;
            }
                if(IsACop(playerid))
                {
                format(string, sizeof(string), "--> Boletim de Ocorrкncia de %s(%d): %s -->", PlayerName(playerid), playerid, (result));
                ABroadCast(0xFFFF66FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado com sucesso aos COPs, aguarde por uma resposta...");
                }
                }
Erros:

pawn Код:
C:\Users\Shum\Desktop\Server 0.3e\pawno\include\seif_walk.inc(39) : error 004: function "Walk_OnPlayerKeyStateChange" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\pawno\include\servermoneyGM.inc(16) : error 004: function "GMExit" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\pawno\include\servermoneyGM.inc(47) : error 004: function "OnPlayerHaveExtraCash" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\pawno\include\servermoneyGM.inc(84) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(905) : error 004: function "SaveCars" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1841) : error 017: undefined symbol "GetPlayerOrg"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1848) : error 017: undefined symbol "GetPlayerOrg"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1888) : error 017: undefined symbol "GetName"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1889) : error 017: undefined symbol "GetName"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1890) : error 017: undefined symbol "GetName"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1940) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1950) : error 004: function "OnPlayerText" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(1950) : error 004: function "OnPlayerText" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(3276) : error 004: function "ClearChatbox" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(3367) : error 004: function "ClearChatbox" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(3384) : error 004: function "ClearChatbox" is not implemented
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(4570) : error 017: undefined symbol "IsAGang"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(4577) : error 017: undefined symbol "IsAGang"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(4596) : error 017: undefined symbol "IsAGang"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(4917) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(4959) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5001) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5043) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5072) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5101) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5130) : error 017: undefined symbol "IsNumero"
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(5159) : error 017: undefined symbol "IsNumero"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Se possнvel, tentem me dizer como gerar um log para ser visto in-game todos os boletins jб registrados, obrigado.
Reply
#2

falta uma } no final
Reply
#3

Faltava sim, matou alguns erros, fiquei com 5, escrevi sem querer "strcmd", arrumei, sobrou-me 2 erros e alguns warnings:
pawn Код:
C:\Users\Shum\Desktop\Server 0.3e\pawno\include\servermoneyGM.inc(84) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(14845) : error 029: invalid expression, assumed zero
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(14845) : warning 215: expression has no effect
C:\Users\Shum\Desktop\Server 0.3e\gamemodes\BTL.pwn(14845) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

Este tipo de erro acontece na maioria das vezes que tenta modificar o cуdigo e deixa sobrando ou faltando alguma { }.
Reply
#5

tenta assim..

pawn Код:
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;
            }
            if(IsACop(playerid))
            {
                format(string, sizeof(string), "--> Boletim de Ocorrкncia de %s(%d): %s -->", PlayerName(playerid), playerid, (result));
                ABroadCast(0xFFFF66FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado com sucesso aos COPs, aguarde por uma resposta...");
            }
        }
        return 1;
    }
xau ;*
Reply
#6

Compilou certinho, vlw, se puder me dizer como gerar um log pra ele, agradeзo
Reply
#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
#8

Digao,eu editei o comando pra colocar no meu sv,mas ta sem o log,como que ficaria com o log.(Atй agora testei e ta funfano perfeito).
pawn Код:
if(strcmp(cmd, "/boletimocorrencia", true) == 0 || strcmp(cmd, "/bo", true) == 0)
    {
        if (!PlayerToPoint(3.0, playerid, 250.0496,67.6644,1003.6406) && !PlayerToPoint(3.0, playerid, 246.5846,118.5371,1003.2188) && !PlayerToPoint(3.0, playerid, 325.2144,305.1604,999.1484) && !PlayerToPoint(3.0, playerid, 1522.1292,492.1497,7.1797) && !PlayerToPoint(3.0, playerid, 234.9493,165.6879,1003.0300) && !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: /bo [Breve Descriзгo] [Contato]");
                return 1;
            }
            if(IsACop(playerid) && (OnDuty[playerid]) )
            {
                format(string, sizeof(string), "B.o. de: %s(%d): %s.", PlayerName(playerid), playerid, (result));
                ABroadCast(0xFFFF66FF,string,1);
            }
            SendClientMessage(playerid, COLOR_YELLOW, "Seu Boletim de ocorrencia foi enviado aos policiais de plantгo.");
        }
        return 1;
    }
Reply
#9

Jб postei lб ._.
Reply
#10

Testei o do Digao e o Pawn Compiler parou de pegar, o do Markos pegou tranquilo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)