[Ajuda] Colocar comando em algum TextDraw
#1

1°: Bom Dia! Boa Tarde! Boa Noite!

Galera, estou querendo ajuda para criar uma TextDraw com Comando, como se fosse um "GameTextForAll" mas com a minhas definiзхes. Tipo eu escrevo /anunciar [TEXTO] dai vem o TextDraw que eu criei com que eu escrevi
Desde jб agradeзo!
Reply
#2

Em zcmd e sscanf
pawn Code:
CMD:anunciar(playerid, params[])
{
    new texto[50], string[80];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid, -1, #Use: /anunciar [texto]);
    format(string, sizeof(string),"%s",texto);
    GameTextForAll(string, 5000, 3);
    return 1;
}
Reply
#3

Eu quero fazer meu propio TextDraw nao usar o GameTextForAll e um Style que ja tem!
Reply
#4

Quote:
Originally Posted by TenhoUmaDuvida
View Post
Eu quero fazer meu propio TextDraw nao usar o GameTextForAll e um Style que ja tem!
GameText vocк economiza nas linhas e й mais prбtico '-', especнfica mais oque vocк quer, se for oque eu estou pensando, estude https://sampwiki.blast.hk/wiki/TextDrawSetString
Reply
#5

Olha, eu quero quando digitar o comando /anunciar [TEXTO] Eu possa escrever com o TextDraw que eu Criei!
Reply
#6

й simple, faзa a mesma coisa que o amigo fez sу que inves de GameText usa TextDrawSetString
pawn Code:
CMD:anunciar(playerid, params[])
{
    new texto[50], string[80];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid, -1, #Use: /anunciar [texto]);
    format(string, sizeof(string),"%s",texto);
    TextDrawSetString(NOMEDATEXTDRAW, texto)
    return 1;
}
lembra de criar ela '-'
Reply
#7

Code:
й simple, faзa a mesma coisa que o amigo fez sу que inves de GameText usa TextDrawSetString
pawn Code:
CMD:anunciar(playerid, params[])
{
    new texto[50], string[80];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid, -1, #Use: /anunciar [texto]);
    format(string, sizeof(string),"%s",texto);
    TextDrawSetString(NOMEDATEXTDRAW, texto)
    return 1;
}
lembra de criar ela '-'
Isso no caso seria um FS?
Reply
#8

cara ¬¬ isso й um comando dai vc pega a textdraw que vocк criou qual nome dela?

Textdraw1
Textdraw0
й simples presta atenзгo acessa o link que mandei e todos irгo gozar.
Reply
#9

Se eu criar a TextDraw no meu GM, e colocar o CMD na include "PPC_PlayersCommand" Fica dando erro! e quando nгo da nenhum erro eu chego la no sv e o CMD nao funciona!
Reply
#10

COLOCA A DEFINE DA TEXTDRAW na PPC_Defines ¬¬ tem lб

pawn Code:
new text:Textdraw1;

//mude o nome dela toda para TextdrawBlaBla

//e pronto '-'
Reply
#11

Coloquei la no PPC_DEFINES o Text:MinhaTextDraw e deu os seguintes erros:
pawn Code:
D:\TenhoUmaDuvida\Curioso!\Curioso!\pawno\include\PPC_PlayerCommands.inc(5030) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(465) : error 022: must be lvalue (non-constant)
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(466) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(467) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(468) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(469) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(470) : warning 213: tag mismatch
D:\TenhoUmaDuvida\Curioso!\Curioso!\gamemodes\GMCurioso!.pwn(471) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#12

voce apagou o do pawn para colocar lб na include? ¬¬ olha

new text: MinhaTextDraw;

vai na include PPC_Defines e vocк deve apagar do .pwn do seu gm o mesmo....

o restante que tem TextDrawCreate e talz vai no OnGameModeInit....
Reply
#13

Tipo o new text:MinhaTextDraw; >> PCC_Defines
TextDrawCreate >> Vai la no GM msm
NO CMD eu ponho isso?
pawn Code:
CMD:anunciar(playerid, params[])
{
    new texto[50], string[80];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid, -1, #Use: /anunciar [texto]);
    format(string, sizeof(string),"%s",texto);
    TextDrawSetString(MinhaTextDraw, texto);
    return 1;
}
Reply
#14

Alguem pode ajudar
Reply
#15

Entгo meu amigo , eu acho que й meio que isso abaixo:

pawn Code:
#include <a_samp>
#include <dini>

TOPO
new Text:TxDNotificador;
#define COLOUR_INFORMACAO 0xFF0000FF

//Aqui abaixo vocк poderб mudar o tamanho, posiзгo,cor,fonte, e etc.
//OnGameModeInit
TxDNotificador = TextDrawCreate(135.000000, 410.000000, "   ");
TextDrawBackgroundColor(TxDNotificador, 255);                  
TextDrawFont(TxDNotificador, 1);                                
TextDrawLetterSize(TxDNotificador, 0.270000, 1.200000);  
//TextDrawColor(TxDNotificador, 16711935);
TextDrawSetOutline(TxDNotificador, 1);
TextDrawSetProportional(TxDNotificador, 1);

//OnPlayerSpawn
TextDrawShowForPlayer(playerid, TxDNotificador);
//OnPlayerDeath
TextDrawHideForPlayer(playerid, TxDNotificador);

//PORLБPROFINAL OU MEIO
stock LoadConfig()
{
TextDrawSetString(TxDNotificador, dini_Get("TextDrawNotificar.ini","notificar"));//TextDraw Notificar

//OnPlayerCommandText
dcmd_notificar(playerid,params[]){
if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 4) return SendClientMessage(playerid,COLOUR_ERRO,StringTable[8]);
if(!strlen(params)){CallRemoteFunction("Notificar","s","   "); return 1;}
if(StringTXTBugado(params)) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: Seu texto estб com erros e foi bloqueado para evitar crash's");
CallRemoteFunction("CMDMessageToAdmins","is",playerid,"NOTIFICAR");
CallRemoteFunction("Notificar","s",params);
return 1;}

if(strcmp("/notpiscar", cmdtext, true) == 0) {
if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 1) return SendClientMessage(playerid,0x66CCFFAA,StringTable[8]);
if(NotificarBlinking == false){
NotificarBlinking = true;
KillTimer(TimerNotBlinker);
TimerNotBlinker = SetTimer("NotificarBlink",250, 1);
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Notificar piscando");
}else{
NotificarBlinking = false;
KillTimer(TimerNotBlinker);
TextDrawShowForAll(TxDNotificador);
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Notificar estбtico");}
return 1;}

//MEIO OU FINAL
forward NotRemove();
public NotRemove()
{
TextDrawSetString(TxDNotificador, "   ");
return 1;
}

forward NotificarEx(string[],tempo);
public NotificarEx(string[],tempo)
{
if(tempo < 0){TextDrawSetString(TxDNotificador, Notificando),dini_Set("TextDrawNotificar.ini","notificar",string);return 1;}
if(tempo > 0){SetTimer("NotRemoveEx", tempo, 0);}
TextDrawSetString(TxDNotificador, string);
dini_Set("TextDrawNotificar.ini","notificar",string);
return 1;
}

forward NotificarBlink();
public NotificarBlink()
{
if(NotBlinker == true){
NotBlinker = false;
TextDrawHideForAll(TxDNotificador);
}else{
NotBlinker = true;
TextDrawShowForAll(TxDNotificador);}
return 1;
}

forward Notificar(string[]);
public Notificar(string[])
{
format(Notificando, sizeof(Notificando), "%s",string);
TextDrawSetString(TxDNotificador, string);
dini_Set("TextDrawNotificar.ini","notificar",string);
return 1;
}

forward NotRemoveEx();
public NotRemoveEx()
{
TextDrawSetString(TxDNotificador, Notificando);
return 1;
}

forward NotRemove();
public NotRemove()
{
TextDrawSetString(TxDNotificador, "   ");
return 1;
}
Aqui estб um print:



Obs: Download da pasta aqui POR NA SCRIPTFILES
Nгo testei , qualquer dъvida pode me chamar , o tamanho , posiзгo , fonte , etc pode ser alterado.

Й isso !
Reply
#16

pawn Code:
Entгo meu amigo , eu acho que й meio que isso abaixo:

pawn Code:
#include <a_samp>
#include <dini>

TOPO
new Text:TxDNotificador;
#define COLOUR_INFORMACAO 0xFF0000FF

//Aqui abaixo vocк poderб mudar o tamanho, posiзгo,cor,fonte, e etc.
//OnGameModeInit
TxDNotificador = TextDrawCreate(135.000000, 410.000000, "   ");
TextDrawBackgroundColor(TxDNotificador, 255);                  
TextDrawFont(TxDNotificador, 1);                                
TextDrawLetterSize(TxDNotificador, 0.270000, 1.200000);  
//TextDrawColor(TxDNotificador, 16711935);
TextDrawSetOutline(TxDNotificador, 1);
TextDrawSetProportional(TxDNotificador, 1);

//OnPlayerSpawn
TextDrawShowForPlayer(playerid, TxDNotificador);
//OnPlayerDeath
TextDrawHideForPlayer(playerid, TxDNotificador);

//PORLБPROFINAL OU MEIO
stock LoadConfig()
{
TextDrawSetString(TxDNotificador, dini_Get("TextDrawNotificar.ini","notificar"));//TextDraw Notificar

//OnPlayerCommandText
dcmd_notificar(playerid,params[]){
if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 4) return SendClientMessage(playerid,COLOUR_ERRO,StringTable[8]);
if(!strlen(params)){CallRemoteFunction("Notificar","s","   "); return 1;}
if(StringTXTBugado(params)) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: Seu texto estб com erros e foi bloqueado para evitar crash's");
CallRemoteFunction("CMDMessageToAdmins","is",playerid,"NOTIFICAR");
CallRemoteFunction("Notificar","s",params);
return 1;}

if(strcmp("/notpiscar", cmdtext, true) == 0) {
if(CallRemoteFunction("GetPlayerAdminLevel","i",playerid) < 1) return SendClientMessage(playerid,0x66CCFFAA,StringTable[8]);
if(NotificarBlinking == false){
NotificarBlinking = true;
KillTimer(TimerNotBlinker);
TimerNotBlinker = SetTimer("NotificarBlink",250, 1);
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Notificar piscando");
}else{
NotificarBlinking = false;
KillTimer(TimerNotBlinker);
TextDrawShowForAll(TxDNotificador);
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Notificar estбtico");}
return 1;}

//MEIO OU FINAL
forward NotRemove();
public NotRemove()
{
TextDrawSetString(TxDNotificador, "   ");
return 1;
}

forward NotificarEx(string[],tempo);
public NotificarEx(string[],tempo)
{
if(tempo < 0){TextDrawSetString(TxDNotificador, Notificando),dini_Set("TextDrawNotificar.ini","notificar",string);return 1;}
if(tempo > 0){SetTimer("NotRemoveEx", tempo, 0);}
TextDrawSetString(TxDNotificador, string);
dini_Set("TextDrawNotificar.ini","notificar",string);
return 1;
}

forward NotificarBlink();
public NotificarBlink()
{
if(NotBlinker == true){
NotBlinker = false;
TextDrawHideForAll(TxDNotificador);
}else{
NotBlinker = true;
TextDrawShowForAll(TxDNotificador);}
return 1;
}

forward Notificar(string[]);
public Notificar(string[])
{
format(Notificando, sizeof(Notificando), "%s",string);
TextDrawSetString(TxDNotificador, string);
dini_Set("TextDrawNotificar.ini","notificar",string);
return 1;
}

forward NotRemoveEx();
public NotRemoveEx()
{
TextDrawSetString(TxDNotificador, Notificando);
return 1;
}

forward NotRemove();
public NotRemove()
{
TextDrawSetString(TxDNotificador, "   ");
return 1;
}

Aqui estб um print:



Obs: Download da pasta aqui POR NA SCRIPTFILES
Nгo testei , qualquer dъvida pode me chamar , o tamanho , posiзгo , fonte , etc pode ser alterado.

Й isso !
Mas eu posso digitar meu texto sem ter que reiniciar ou sair do serve? Tipo se eu digitar /cmd [TEXTO] ai aparece essa textdraw com o [TEXTO] que eu digitei?
Obrigado desde jб!
Reply
#17

Sim cara, "/notificar [TEXTO]" ficarб salvo na pasta que te passei, e "/notpiscar" pra ficar piscando, й isso. Teste, se faltar algo me diz!
Reply
#18

Obrigado ae iD4N0N3_.X[X]x!
Reply
#19

De nada meu mano!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)