[Ajuda] Erro /ann
#1

Peguei este comando que esta aparecendo duas texts na tela, gostaria de retirar uma e mudar a fonte

Cуdigo que usei:
Код:
if(strcmp(cmd, "/ann", true) == 0)
    if(pAdmin[playerid] > 0) {

        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[70];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result)) return SendClientMessage(playerid,-1,"Use: /ann [mensagem]");
        if(strlen(result) > 40) return SendClientMessage(playerid,-1,"O mбximo de caracteres permitido й 40");
        if(TempoAnu == 1)
        {
        SendClientMessage(playerid, -1, "Aguarde 5 segundos para anunciar novamente.");
        return 1;
        }
        TempoAnu = 1;
        SetTimer("TAnu", 6000, 1);
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
		format(string,sizeof(string),"~r~x ~w~%s ~r~x", result);
        Textoanu = TextDrawCreate(325.000000, 194.000000, string);
        TextDrawBackgroundColor(Textoanu, 255);
        TextDrawFont(Textoanu, 1);
        TextDrawLetterSize(Textoanu, 0.529999, 4.199999);
        TextDrawColor(Textoanu, 16711935);
        TextDrawSetOutline(Textoanu, 0);
        GameTextForAll(string, 5000, 3);

        for(new i; i < MAX_PLAYERS; i ++)
        {
            TextDrawShowForPlayer(i, Textoanu);
        }
        SetTimer("DestruirTextDrawToAll",5000, false);
        return 1;
    }
Imagem do erro:

Reply
#2

Paia , vocк tem que usar a logica , praque criar uma textdraw so quando executa o comando ?
E mais facil criar a text quando o jogador conecta e setar a string dela quando usar o comando , assim diminui seu codigo e evita estes bugs inuteis.
Reply
#3

Й para anunciar eventos, poderia ajudar a retirar uma?
Reply
#4

PHP код:
    format(string,sizeof(string),"~r~x ~w~%s ~r~x"result);
        
Textoanu TextDrawCreate(325.000000194.000000string);
        
TextDrawBackgroundColor(Textoanu255);
        
TextDrawFont(Textoanu1);
        
TextDrawLetterSize(Textoanu0.5299994.199999);
        
TextDrawColor(Textoanu16711935);
        
TextDrawSetOutline(Textoanu0);
        
GameTextForAll(string50003);// apaga isso que num e textdraw 
Esses cara que tem preguiзa de aprender e foda .
Reply
#5

Acho que a "dificuldade" desse comando й desnecessбria. Poderia ter feito de um jeito mais fбcil.
Vocк pode criar a textdraw em OnGameModeInit e usar format + TextDrawSetString no comando para alterar o texto.
Reply
#6

Jб foi resolvido.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)