SA-MP Forums Archive
[Ajuda] Cores { } - 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] Cores { } (/showthread.php?tid=587338)



Cores { } - LuisFerreira - 30.08.2015

Gente como eu posso adcionar cor no meu label?

PHP код:
COMMAND:criarlabel3(playerid, params[])
{
SendAdminText(playerid, "/criarlabel3", params);
        if (
APlayerData[playerid][PlayerLevel] >= 3)
            {
           new 
Float:PosX,
               
Float:PosY,
               
Float:PosZ;
           new 
texto[256];
           new 
string[256];
                {
                   if(
sscanf(params, "s[256]", texto)) return SendClientMessage(playerid, 0xFF0000FF, "Use: /criarlabel3 [Texto]");
                   
GetPlayerPos(playerid, PosX, PosY, PosZ);
                   
format(string, sizeof(string), "%s", texto);
                   
Create3DTextLabel(string, 0x00ff00ff, PosX, PosY, PosZ, 40,0);
                   
format(string, sizeof(string), "Vocк criou um TextLabel com a mensagem: %s", texto);
                   
SendClientMessage(playerid, 0x00FF00FF, string);
               }    }
           return 
true;
} 
Por exemplo eu digitar: /criarlabel3 {FFFF00}Alo


Re: Cores { } - Andre02 - 30.08.2015

Usando Hex code
PHP код:
{FFFFFF}Texto 



Re: Cores { } - LuisFerreira - 30.08.2015

Sim mais queria como eu disse, {FFFF99}Texto, eu poder adicionar varias cores..


Re: Cores { } - Boot - 30.08.2015

Sei que nгo vou estar te ajudando, mas tambйm tenho essa dъvida. A propуsito, nгo precisa usar o format nesse script, pois o sscanf jб irб guadar a string que vocк digitar dentro da variбvel texto.


Re: Cores { } - LuisFerreira - 30.08.2015

Ajudm ae galera?


Re: Cores { } - widhost - 30.08.2015

Quote:
Originally Posted by LuisFerreira
Посмотреть сообщение
Sim mais queria como eu disse, {FFFF99}Texto, eu poder adicionar varias cores..
Pode fazer isso tambйm {FFFF99}Texto{FFFFFF}Qualquer{00000}Aqui


Re: Cores { } - LuisFerreira - 30.08.2015

Vocкs nao entenderam vei.. tipo й pra criar label in-game, ae eu queria digitar assim la /criarlabel3 {COR}TEXTO, e no comando que citei nao da... ALGUEM?


Re: Cores { } - [BOPE]Seu._.Madruga - 30.08.2015

Espero ter ajudado.
PHP код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>

#define DIALOG_LABEL 1 
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(
dialogid == DIALOG_LABEL)
    {
        if(
response)
        {
            new 
Float:Pos[3];
            
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
            
Create3DTextLabel(inputtext,-1, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
            
SendClientMessage(playerid, 0x00FF80AA, "Label Criado!");
        }
    }
    return 
1;
} 
PHP код:
CMD:label(playerid)
{
    
ShowPlayerDialog(playerid,DIALOG_LABEL, DIALOG_STYLE_INPUT, "Criacao de Label", "Digite abaixo o texto e cores do seu Label", "Criar", "Cancelar");
    return 
1;
}