Criar um comando clicбvel em Textdraw -
JuniorZ - 03.03.2017
Olб, eu queria criar um comando de /creditos mбs em text draw.
Eu jб fiz a text draw sу que nгo sei como torna-la clicбvel, alguem poderia dar uma luz ?
OBS: Jб procurei diversos tutoriais, mбs nenhum ensinou corretamente como que faz desde um comando atй a text draw.
pawn Код:
Textdraw0 = TextDrawCreate(178.823532, 138.250000, "LD_SPAC:white");
TextDrawLetterSize(Textdraw0, 0.000000, 0.000000);
TextDrawTextSize(Textdraw0, 282.352905, 217.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 4);
Textdraw1 = TextDrawCreate(465.529388, 139.750000, "usebox");
TextDrawLetterSize(Textdraw1, 0.000000, 3.183333);
TextDrawTextSize(Textdraw1, 176.823532, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, 102);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 0);
Textdraw2 = TextDrawCreate(181.176483, 149.916625, "[] CREDITOS GTA WAR []");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, 16711935);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 2);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3 = TextDrawCreate(383.176452, 200.416656, "usebox");
TextDrawLetterSize(Textdraw3, 0.000000, 1.174076);
TextDrawTextSize(Textdraw3, 249.764694, 0.000000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, 0);
TextDrawUseBox(Textdraw3, true);
TextDrawBoxColor(Textdraw3, 102);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 0);
TextDrawFont(Textdraw3, 0);
Textdraw4 = TextDrawCreate(281.411621, 199.500000, "DONOS");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, 41215);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 2);
TextDrawSetProportional(Textdraw4, 1);
Textdraw5 = TextDrawCreate(239.529449, 214.666641, "JuniiorZ");
TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
TextDrawAlignment(Textdraw5, 1);
TextDrawColor(Textdraw5, 16777215);
TextDrawSetShadow(Textdraw5, 0);
TextDrawSetOutline(Textdraw5, 1);
TextDrawBackgroundColor(Textdraw5, 51);
TextDrawFont(Textdraw5, 3);
TextDrawSetProportional(Textdraw5, 1);
Textdraw6 = TextDrawCreate(403.411743, 216.166671, "usebox");
TextDrawLetterSize(Textdraw6, 0.000000, 1.498149);
TextDrawTextSize(Textdraw6, 231.882354, 0.000000);
TextDrawAlignment(Textdraw6, 1);
TextDrawColor(Textdraw6, 0);
TextDrawUseBox(Textdraw6, true);
TextDrawBoxColor(Textdraw6, 102);
TextDrawSetShadow(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 0);
TextDrawFont(Textdraw6, 0);
Textdraw7 = TextDrawCreate(283.764678, 245.000061, "MAPAS");
TextDrawLetterSize(Textdraw7, 0.449999, 1.600000);
TextDrawAlignment(Textdraw7, 1);
TextDrawColor(Textdraw7, 41215);
TextDrawSetShadow(Textdraw7, 0);
TextDrawSetOutline(Textdraw7, 1);
TextDrawBackgroundColor(Textdraw7, 51);
TextDrawFont(Textdraw7, 2);
TextDrawSetProportional(Textdraw7, 1);
Textdraw8 = TextDrawCreate(384.117614, 243.583328, "usebox");
TextDrawLetterSize(Textdraw8, 0.000000, 1.368519);
TextDrawTextSize(Textdraw8, 250.705871, 0.000000);
TextDrawAlignment(Textdraw8, 1);
TextDrawColor(Textdraw8, 0);
TextDrawUseBox(Textdraw8, true);
TextDrawBoxColor(Textdraw8, 102);
TextDrawSetShadow(Textdraw8, 0);
TextDrawSetOutline(Textdraw8, 0);
TextDrawFont(Textdraw8, 0);
Textdraw9 = TextDrawCreate(267.764770, 259.000000, "FORUM SA-MP");
TextDrawLetterSize(Textdraw9, 0.449999, 1.600000);
TextDrawAlignment(Textdraw9, 1);
TextDrawColor(Textdraw9, 16777215);
TextDrawSetShadow(Textdraw9, 0);
TextDrawSetOutline(Textdraw9, 1);
TextDrawBackgroundColor(Textdraw9, 51);
TextDrawFont(Textdraw9, 3);
TextDrawSetProportional(Textdraw9, 1);
Textdraw10 = TextDrawCreate(404.823455, 261.083343, "usebox");
TextDrawLetterSize(Textdraw10, 0.000000, 1.303703);
TextDrawTextSize(Textdraw10, 232.823532, 0.000000);
TextDrawAlignment(Textdraw10, 1);
TextDrawColor(Textdraw10, 0);
TextDrawUseBox(Textdraw10, true);
TextDrawBoxColor(Textdraw10, 102);
TextDrawSetShadow(Textdraw10, 0);
TextDrawSetOutline(Textdraw10, 0);
TextDrawFont(Textdraw10, 0);
Textdraw11 = TextDrawCreate(332.352935, 330.500000, "usebox");
TextDrawLetterSize(Textdraw11, 0.000000, 2.340742);
TextDrawTextSize(Textdraw11, 285.058837, 0.000000);
TextDrawAlignment(Textdraw11, 1);
TextDrawColor(Textdraw11, 0);
TextDrawUseBox(Textdraw11, true);
TextDrawBoxColor(Textdraw11, 102);
TextDrawSetShadow(Textdraw11, 0);
TextDrawSetOutline(Textdraw11, 0);
TextDrawFont(Textdraw11, 0);
Textdraw12 = TextDrawCreate(295.999938, 335.416503, "OK");
TextDrawLetterSize(Textdraw12, 0.449999, 1.600000);
TextDrawAlignment(Textdraw12, 1);
TextDrawColor(Textdraw12, -1);
TextDrawSetShadow(Textdraw12, 0);
TextDrawSetOutline(Textdraw12, 1);
TextDrawBackgroundColor(Textdraw12, 51);
TextDrawFont(Textdraw12, 2);
TextDrawSetProportional(Textdraw12, 1);
Textdraw13 = TextDrawCreate(187.764785, 292.833312, "AGRADECEMOS A TODOS OS PLAYERS");
TextDrawLetterSize(Textdraw13, 0.449999, 1.600000);
TextDrawAlignment(Textdraw13, 1);
TextDrawColor(Textdraw13, -1);
TextDrawSetShadow(Textdraw13, 0);
TextDrawSetOutline(Textdraw13, 1);
TextDrawBackgroundColor(Textdraw13, 51);
TextDrawFont(Textdraw13, 3);
TextDrawSetProportional(Textdraw13, 1);
Textdraw14 = TextDrawCreate(184.000000, 291.083312, "LD_SPAC:white");
TextDrawLetterSize(Textdraw14, 0.000000, 0.000000);
TextDrawTextSize(Textdraw14, 271.058837, 22.166687);
TextDrawAlignment(Textdraw14, 1);
TextDrawColor(Textdraw14, -65281);
TextDrawSetShadow(Textdraw14, 0);
TextDrawSetOutline(Textdraw14, 0);
TextDrawFont(Textdraw14, 4);
Re: Criar um comando clicбvel em Textdraw -
Felipe1241421 - 03.03.2017
Nгo entendi muito bem o que vocк quer .-.
Vocк quer criar um comando tipo '/creditos' e aparecer as textdraws?
@Edit
Fiz a textdraw aqui, mais de um modo diferente, apertando o ESC a Textdraw some nгo sei se serve mais tб aн
PHP код:
#include <a_samp>
#include <zcmd>
new Text:Textdraw[15];
new bool:tCreditos[MAX_PLAYERS];
public OnGameModeInit()
{
Textdraw[0] = TextDrawCreate(178.823532, 138.250000, "LD_SPAC:white");
TextDrawLetterSize(Textdraw[0], 0.000000, 0.000000);
TextDrawTextSize(Textdraw[0], 282.352905, 217.000000);
TextDrawAlignment(Textdraw[0], 1);
TextDrawColor(Textdraw[0], -1);
TextDrawSetShadow(Textdraw[0], 0);
TextDrawSetOutline(Textdraw[0], 0);
TextDrawFont(Textdraw[0], 4);
Textdraw[1] = TextDrawCreate(465.529388, 139.750000, "usebox");
TextDrawLetterSize(Textdraw[1], 0.000000, 3.183333);
TextDrawTextSize(Textdraw[1], 176.823532, 0.000000);
TextDrawAlignment(Textdraw[1], 1);
TextDrawColor(Textdraw[1], 0);
TextDrawUseBox(Textdraw[1], true);
TextDrawBoxColor(Textdraw[1], 102);
TextDrawSetShadow(Textdraw[1], 0);
TextDrawSetOutline(Textdraw[1], 0);
TextDrawFont(Textdraw[1], 0);
Textdraw[2] = TextDrawCreate(181.176483, 149.916625, "[] CREDITOS GTA WAR []");
TextDrawLetterSize(Textdraw[2], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[2], 1);
TextDrawColor(Textdraw[2], 16711935);
TextDrawSetShadow(Textdraw[2], 0);
TextDrawSetOutline(Textdraw[2], 1);
TextDrawBackgroundColor(Textdraw[2], 51);
TextDrawFont(Textdraw[2], 2);
TextDrawSetProportional(Textdraw[2], 1);
Textdraw[3] = TextDrawCreate(383.176452, 200.416656, "usebox");
TextDrawLetterSize(Textdraw[3], 0.000000, 1.174076);
TextDrawTextSize(Textdraw[3], 249.764694, 0.000000);
TextDrawAlignment(Textdraw[3], 1);
TextDrawColor(Textdraw[3], 0);
TextDrawUseBox(Textdraw[3], true);
TextDrawBoxColor(Textdraw[3], 102);
TextDrawSetShadow(Textdraw[3], 0);
TextDrawSetOutline(Textdraw[3], 0);
TextDrawFont(Textdraw[3], 0);
Textdraw[4] = TextDrawCreate(281.411621, 199.500000, "DONOS");
TextDrawLetterSize(Textdraw[4], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[4], 1);
TextDrawColor(Textdraw[4], 41215);
TextDrawSetShadow(Textdraw[4], 0);
TextDrawSetOutline(Textdraw[4], 1);
TextDrawBackgroundColor(Textdraw[4], 51);
TextDrawFont(Textdraw[4], 2);
TextDrawSetProportional(Textdraw[4], 1);
Textdraw[5] = TextDrawCreate(239.529449, 214.666641, "JuniiorZ");
TextDrawLetterSize(Textdraw[5], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[5], 1);
TextDrawColor(Textdraw[5], 16777215);
TextDrawSetShadow(Textdraw[5], 0);
TextDrawSetOutline(Textdraw[5], 1);
TextDrawBackgroundColor(Textdraw[5], 51);
TextDrawFont(Textdraw[5], 3);
TextDrawSetProportional(Textdraw[5], 1);
Textdraw[6] = TextDrawCreate(403.411743, 216.166671, "usebox");
TextDrawLetterSize(Textdraw[6], 0.000000, 1.498149);
TextDrawTextSize(Textdraw[6], 231.882354, 0.000000);
TextDrawAlignment(Textdraw[6], 1);
TextDrawColor(Textdraw[6], 0);
TextDrawUseBox(Textdraw[6], true);
TextDrawBoxColor(Textdraw[6], 102);
TextDrawSetShadow(Textdraw[6], 0);
TextDrawSetOutline(Textdraw[6], 0);
TextDrawFont(Textdraw[6], 0);
Textdraw[7] = TextDrawCreate(283.764678, 245.000061, "MAPAS");
TextDrawLetterSize(Textdraw[7], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[7], 1);
TextDrawColor(Textdraw[7], 41215);
TextDrawSetShadow(Textdraw[7], 0);
TextDrawSetOutline(Textdraw[7], 1);
TextDrawBackgroundColor(Textdraw[7], 51);
TextDrawFont(Textdraw[7], 2);
TextDrawSetProportional(Textdraw[7], 1);
Textdraw[8] = TextDrawCreate(384.117614, 243.583328, "usebox");
TextDrawLetterSize(Textdraw[8], 0.000000, 1.368519);
TextDrawTextSize(Textdraw[8], 250.705871, 0.000000);
TextDrawAlignment(Textdraw[8], 1);
TextDrawColor(Textdraw[8], 0);
TextDrawUseBox(Textdraw[8], true);
TextDrawBoxColor(Textdraw[8], 102);
TextDrawSetShadow(Textdraw[8], 0);
TextDrawSetOutline(Textdraw[8], 0);
TextDrawFont(Textdraw[8], 0);
Textdraw[9] = TextDrawCreate(267.764770, 259.000000, "FORUM SA-MP");
TextDrawLetterSize(Textdraw[9], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[9], 1);
TextDrawColor(Textdraw[9], 16777215);
TextDrawSetShadow(Textdraw[9], 0);
TextDrawSetOutline(Textdraw[9], 1);
TextDrawBackgroundColor(Textdraw[9], 51);
TextDrawFont(Textdraw[9], 3);
TextDrawSetProportional(Textdraw[9], 1);
Textdraw[10] = TextDrawCreate(404.823455, 261.083343, "usebox");
TextDrawLetterSize(Textdraw[10], 0.000000, 1.303703);
TextDrawTextSize(Textdraw[10], 232.823532, 0.000000);
TextDrawAlignment(Textdraw[10], 1);
TextDrawColor(Textdraw[10], 0);
TextDrawUseBox(Textdraw[10], true);
TextDrawBoxColor(Textdraw[10], 102);
TextDrawSetShadow(Textdraw[10], 0);
TextDrawSetOutline(Textdraw[10], 0);
TextDrawFont(Textdraw[10], 0);
Textdraw[11] = TextDrawCreate(332.352935, 330.500000, "usebox");
TextDrawLetterSize(Textdraw[11], 0.000000, 2.340742);
TextDrawTextSize(Textdraw[11], 285.058837, 0.000000);
TextDrawAlignment(Textdraw[11], 1);
TextDrawColor(Textdraw[11], 0);
TextDrawUseBox(Textdraw[11], true);
TextDrawBoxColor(Textdraw[11], 102);
TextDrawSetShadow(Textdraw[11], 0);
TextDrawSetOutline(Textdraw[11], 0);
TextDrawFont(Textdraw[11], 0);
Textdraw[12] = TextDrawCreate(295.999938, 335.416503, "OK");
TextDrawLetterSize(Textdraw[12], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[12], 1);
TextDrawColor(Textdraw[12], -1);
TextDrawSetShadow(Textdraw[12], 0);
TextDrawSetOutline(Textdraw[12], 1);
TextDrawBackgroundColor(Textdraw[12], 51);
TextDrawFont(Textdraw[12], 2);
TextDrawSetProportional(Textdraw[12], 1);
Textdraw[13] = TextDrawCreate(187.764785, 292.833312, "AGRADECEMOS A TODOS OS PLAYERS");
TextDrawLetterSize(Textdraw[13], 0.449999, 1.600000);
TextDrawAlignment(Textdraw[13], 1);
TextDrawColor(Textdraw[13], -1);
TextDrawSetShadow(Textdraw[13], 0);
TextDrawSetOutline(Textdraw[13], 1);
TextDrawBackgroundColor(Textdraw[13], 51);
TextDrawFont(Textdraw[13], 3);
TextDrawSetProportional(Textdraw[13], 1);
Textdraw[14] = TextDrawCreate(184.000000, 291.083312, "LD_SPAC:white");
TextDrawLetterSize(Textdraw[14], 0.000000, 0.000000);
TextDrawTextSize(Textdraw[14], 271.058837, 22.166687);
TextDrawAlignment(Textdraw[14], 1);
TextDrawColor(Textdraw[14], -65281);
TextDrawSetShadow(Textdraw[14], 0);
TextDrawSetOutline(Textdraw[14], 0);
TextDrawFont(Textdraw[14], 4);
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
CMD:creditos(playerid)
{
if(tCreditos[playerid] == true)
return SendClientMessage(playerid, -1, "Vocк jб estб vendo seu RG!");
for(new i; i < sizeof(Textdraw); i++) { TextDrawShowForPlayer(playerid, Text:Textdraw[i]); }
SelectTextDraw(playerid, 0x4F4F4FFF);
tCreditos[playerid] = true;
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW)
{
if(tCreditos[playerid] == true)
{
for(new u; u < sizeof(Textdraw); ++u) { TextDrawHideForPlayer(playerid, Text:Textdraw[u]); }
CancelSelectTextDraw(playerid);
tCreditos[playerid] = false;
}
}
return 1;
}
Re: Criar um comando clicбvel em Textdraw -
JuniorZ - 05.03.2017
Entгo, eu queria um comando tipo
/creditos e a text draw abria. Mбs valeu por mandar esse mйtodo tambйm amigo.