SA-MP Forums Archive
[Ajuda] Me ajuda a arrumar meu cod, n conheзo essas func - 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] Me ajuda a arrumar meu cod, n conheзo essas func (/showthread.php?tid=510707)



Me ajuda a arrumar meu cod, n conheзo essas func - pedrotvr - 02.05.2014

Como nessa SS:


Queria fazer isso aн pra qnd um membro da policia civil desse /distintivo eu tentei assim:

Erros:
pawn Код:
playertextid = CreatePlayer3DTextLabel(playerid,"Policia Civil",COLOR_BLUE,X,Y,Z,40.0); // warning 204: symbol is assigned a value that is never used: "playertextid"
pawn Код:
Delete3DTextLabel(playertextid); // warning 213: tag mismatch
Codigo:
pawn Код:
if(strcmp(cmd, "/distintivo", true) == 0)
    {
        if(PlayerInfo[playerid][pLider] != 16 && PlayerInfo[playerid][pMembro] != 16) return SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um Policial Civil.");
        if(distintivo[playerid] == 0) {
            distintivo[playerid] = 1;
            new PlayerText3D:playertextid;
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos( playerid, X, Y, Z );
            playertextid = CreatePlayer3DTextLabel(playerid,"Policia Civil",COLOR_BLUE,X,Y,Z,40.0); // warning 204: symbol is assigned a value that is never used: "playertextid"
            format(string, sizeof(string), "O policial civil %s colocou seu distintivo a mostra.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
        if(distintivo[playerid] == 1) {
            distintivo[playerid] = 0;
           
            new PlayerText3D:playertextid;
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos( playerid, X, Y, Z );
            playertextid = CreatePlayer3DTextLabel(playerid,"Policia Civil",COLOR_BLUE,X,Y,Z,40.0);
           
            Delete3DTextLabel(playertextid); // warning 213: tag mismatch
            format(string, sizeof(string), "O policial civil %s guardou seu distintivo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
    }



Re: Me ajuda a arrumar meu cod, n conheзo essas func - Input - 02.05.2014

Topo do GM (Variavel Global):
pawn Код:
new PlayerText3D:playertextid;
Comandos:
pawn Код:
if(strcmp(cmd, "/distintivo", true) == 0)
    {
        if(PlayerInfo[playerid][pLider] != 16 && PlayerInfo[playerid][pMembro] != 16) return SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um Policial Civil.");
        if(distintivo[playerid] == 0) {
            distintivo[playerid] = 1;
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos( playerid, X, Y, Z );
            playertextid = CreatePlayer3DTextLabel(playerid,"Policia Civil",COLOR_BLUE,X,Y,Z,40.0); // warning 204: symbol is assigned a value that is never used: "playertextid"
            format(string, sizeof(string), "O policial civil %s colocou seu distintivo a mostra.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
        if(distintivo[playerid] == 1) {
            distintivo[playerid] = 0;
           
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos( playerid, X, Y, Z );
            playertextid = CreatePlayer3DTextLabel(playerid,"Policia Civil",COLOR_BLUE,X,Y,Z,40.0);
           
            Delete3DTextLabel(playertextid); // warning 213: tag mismatch
            format(string, sizeof(string), "O policial civil %s guardou seu distintivo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
    }



Re: Me ajuda a arrumar meu cod, n conheзo essas func - pedrotvr - 02.05.2014

pawn Код:
warning 213: tag mismatch
Em:
pawn Код:
Delete3DTextLabel(playertextid); // warning 213: tag mismatch



Re: Me ajuda a arrumar meu cod, n conheзo essas func - ForT - 02.05.2014

Tente:
pawn Код:
if(strcmp(cmd, "/distintivo", true) == 0)
    {
        if(PlayerInfo[playerid][pLider] != 16 && PlayerInfo[playerid][pMembro] != 16)
            return SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um Policial Civil.");

        if(distintivo[playerid] == 0) {
            distintivo[playerid] = 1;
            playertextid[playerid] = Create3DTextLabel("Policia Civil",COLOR_BLUE,0,0,0,40.0, 0);
            Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "O policial civil %s colocou seu distintivo a mostra.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
       
        if(distintivo[playerid] == 1) {
            distintivo[playerid] = 0;
            Delete3DTextLabel(playertextid[playerid]); // warning 213: tag mismatch
            format(string, sizeof(string), "O policial civil %s guardou seu distintivo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
Nгo esqueзa da variavel global:
pawn Код:
new Text3D:playertextid[MAX_PLAYERS];



Re: Me ajuda a arrumar meu cod, n conheзo essas func - luccagomes15 - 02.05.2014

Quote:
Originally Posted by ForT
Посмотреть сообщение
Tente:
pawn Код:
if(strcmp(cmd, "/distintivo", true) == 0)
    {
        if(PlayerInfo[playerid][pLider] != 16 && PlayerInfo[playerid][pMembro] != 16)
            return SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um Policial Civil.");

        if(distintivo[playerid] == 0) {
            distintivo[playerid] = 1;
            playertextid[playerid] = Create3DTextLabel("Policia Civil",COLOR_BLUE,0,0,0,40.0, 0);
            Attach3DTextLabelToPlayer(playertextid[playerid], playerid, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "O policial civil %s colocou seu distintivo a mostra.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
       
        if(distintivo[playerid] == 1) {
            distintivo[playerid] = 0;
            Delete3DTextLabel(playertextid[playerid]); // warning 213: tag mismatch
            format(string, sizeof(string), "O policial civil %s guardou seu distintivo.", PlayerName(playerid));
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
Nгo esqueзa da variavel global:
pawn Код:
new Text3D:playertextid[MAX_PLAYERS];
Compilou sem erros, mas quando eu dou o comando no jogo o texto Policia Civil na skin do player nгo aparece =\


Re: Me ajuda a arrumar meu cod, n conheзo essas func - ForT - 02.05.2014

Й porque aparece sу pros outros players, pra quem digitou o comando nгo aparece !


Re: Me ajuda a arrumar meu cod, n conheзo essas func - pedrotvr - 02.05.2014

Funcionou entгo REP+!!
Tem como eu colocar em negrito ou mais forte pq qse n da pra ver!