SA-MP Forums Archive
[Ajuda] A Algo errado com este comando. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] A Algo errado com este comando. (/showthread.php?tid=458306)



A Algo errado com este comando. - PainBR - 15.08.2013

Este seria o comando de criar barraca do mendingo, nгo esta aparecendo quando cria.. nгo aparece os Bloqueios as Barreiras policiais nem mesmo o paredгo dos Administradores..


pawn Код:
if(strcmp(cmdtext, "/plantarbarraca", true)==0 || strcmp(cmdtext, "/pbarraca", true)==0)
    {
        if (PlayerInfo[playerid][pEmprego] != 10) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й Mendigo!");
        if(PlayerInfo[playerid][pJailed] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode plantar barracas na cadeia!");
           return 1;
        }
        if(PlayerPaintballing[playerid] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode por barracas no evento!");
           return 1;
        }
        if (PlayerInfo[playerid][pBarraca] != 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк sу pode implantar uma barraca por vez, /rbarraca - para remover sua barraca.");
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, A);
        PlayerInfo[playerid][pBarraca] = CreateObject(1457, X, Y, Z, 0.0, 0.0, A+180, 300.0);
        SetPlayerPos(playerid, X, Y, Z+4);
        GameTextForPlayer(playerid, "~w~Barraquinha ~r~Criada", 5000, 5);
        SendClientMessage(playerid, COLOR_GREEN, "Barraca Implantada... Use /rbarraca para remover e poder criar em outro lugar!.");
        SendClientMessage(playerid, COLOR_YELLOW, "Agora vocк pode trafegar ou dormir em sua barraca");
        return 1;
    }
    if(strcmp(cmdtext, "/removerbarraca", true)==0 || strcmp(cmdtext, "/rbarraca", true)==0)
    {
        if (PlayerInfo[playerid][pEmprego] != 10)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Mendigo !");
            return 1;
        }
        if (PlayerInfo[playerid][pBarraca] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo criou nenhuma barraca!");
            return 1;
        }
        RemoveBarraca(playerid);
        SendClientMessage(playerid, COLOR_GREEN, "Barracas removidas com sucesso.");
        return 1;
    }



Re: A Algo errado com este comando. - Juniiro3 - 15.08.2013

Mude isso:
pawn Код:
if(PlayerInfo[playerid][pJailed] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode plantar barracas na cadeia!");
           return 1;
        }
        if(PlayerPaintballing[playerid] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode por barracas no evento!");
           return 1;
        }
Para isso:

pawn Код:
if(PlayerInfo[playerid][pJailed] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode plantar barracas na cadeia!");
           return 0;
        }
        if(PlayerPaintballing[playerid] != 0)
        {
           SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode por barracas no evento!");
           return 0;
        }
E isso:

pawn Код:
if (PlayerInfo[playerid][pEmprego] != 10)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Mendigo !");
            return 1;
        }
        if (PlayerInfo[playerid][pBarraca] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo criou nenhuma barraca!");
            return 1;
        }

Para isso:

pawn Код:
if (PlayerInfo[playerid][pEmprego] != 10)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Mendigo !");
            return 0;
        }
        if (PlayerInfo[playerid][pBarraca] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Vocк nгo criou nenhuma barraca!");
            return 0;
        }
Quanto aos objetos nгo aparecerem, use o plugin + include STREAMER, e troque de CreateObject para CreateDynamicObject


Re: A Algo errado com este comando. - PainBR - 15.08.2013

pawn Код:
\pawno\include\streamer.inc(256) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
\gamemodes\teste.pwn(59286) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          13972 bytes
Code size:          2985664 bytes
Data size:          6144808 bytes
Stack/heap size:      16384 bytes; estimated max. usage=7945 cells (31780 bytes)
Total requirements: 9160828 bytes

2 Warnings.
Linha: 59286

pawn Код:
PlayerInfo[playerid][pBarraca] = CreateDynamicObject(1457, X, Y, Z, 0.0, 0.0, A+180, 300.0);



Re: A Algo errado com este comando. - Juniiro3 - 16.08.2013

Qual й a linha 256 do seu streamer ?

EDIT:

Onde tem A+180 tenta por A+180.0


Re: A Algo errado com este comando. - PainBR - 16.08.2013

Linha 256:

pawn Код:
#define OnGameModeInit Streamer_OnGameModeInit
(Mesmo alterando 180, para 180.0 persiste o warning.)


Re: A Algo errado com este comando. - Juniiro3 - 16.08.2013

Tenta por o meu streamer, tб um pouco diferente e nгo da nenhum erro.

http://pastebin.com/pgBLnTfQ


Re: A Algo errado com este comando. - PainBR - 16.08.2013

=/

pawn Код:
\pawno\include\streamer.inc(268) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit")
\gamemodes\teste.pwn(59286) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          13956 bytes
Code size:          2985912 bytes
Data size:          6144808 bytes
Stack/heap size:      16384 bytes; estimated max. usage=7945 cells (31780 bytes)
Total requirements: 9161060 bytes

2 Warnings.



Re: A Algo errado com este comando. - Juniiro3 - 16.08.2013

Entгo nгo sei :/

Talvez esteja dandoconflito com algum outro FS/Funcao do seu GM


Re: A Algo errado com este comando. - PainBR - 16.08.2013

Nгo utilizo FS, pois sei de conflitos que possa causar.