28.10.2015, 22:53
Bom galera, eu tava criando umas textdraw's e elas sгo realmente boas (teleportes a base de textdraw selecionбvel) elas funcionam e talz, as respectivas TextDraw's criadas em TeleMenu_p1 funcionam certinho, porйm quando clico em Proximo aparece apenas "Proximo Menu..." mas nгo aparece a TextDraw TeleMenu_p2 (page 2), nгo sei se empreguei muito bem essa TextDraw e por isso peзo ajuda!
PHP код:
#include <a_samp>
#pragma dynamic 16384
new Text:TeleMenu_p1[7];
new Text:TeleMenu_p2[7];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Textdraw teleporting - tut for showing\n how textdraw selecting works");
print("--------------------------------------\n");
//--------------------------------TeleMenu_p1------------------------------------
TeleMenu_p1[0] = TextDrawCreate(100.929275, 136.916687, "_");
TextDrawLetterSize(TeleMenu_p1[0], 0.538352, 13.243331);
TextDrawTextSize(TeleMenu_p1[0], -1709.600341, 0.000000);
TextDrawAlignment(TeleMenu_p1[0], 3);
TextDrawColor(TeleMenu_p1[0], 151);
TextDrawUseBox(TeleMenu_p1[0], 1);
TextDrawBoxColor(TeleMenu_p1[0], -16777142);
TextDrawSetShadow(TeleMenu_p1[0], 0);
TextDrawSetOutline(TeleMenu_p1[0], 0);
TextDrawBackgroundColor(TeleMenu_p1[0], -16776961);
TextDrawFont(TeleMenu_p1[0], 1);
TextDrawSetProportional(TeleMenu_p1[0], 1);
TextDrawSetShadow(TeleMenu_p1[0], 0);
TeleMenu_p1[1] = TextDrawCreate(96.782493, 137.066543, "TELEPORT");
TextDrawLetterSize(TeleMenu_p1[1], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p1[1], 3);
TextDrawColor(TeleMenu_p1[1], -1);
TextDrawSetShadow(TeleMenu_p1[1], 0);
TextDrawSetOutline(TeleMenu_p1[1], 3);
TextDrawBackgroundColor(TeleMenu_p1[1], 255);
TextDrawFont(TeleMenu_p1[1], 2);
TextDrawSetProportional(TeleMenu_p1[1], 1);
TextDrawSetShadow(TeleMenu_p1[1], 0);
TeleMenu_p1[2] = TextDrawCreate(50.864700, 160.433456, "Tele_1");
TextDrawLetterSize(TeleMenu_p1[2], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p1[2], 3);
TextDrawColor(TeleMenu_p1[2], 16777215);
TextDrawSetShadow(TeleMenu_p1[2], 0);
TextDrawSetOutline(TeleMenu_p1[2], 0);
TextDrawBackgroundColor(TeleMenu_p1[2], 255);
TextDrawFont(TeleMenu_p1[2], 3);
TextDrawSetProportional(TeleMenu_p1[2], 1);
TextDrawSetShadow(TeleMenu_p1[2], 0);
TextDrawSetSelectable(TeleMenu_p1[2], true);
TeleMenu_p1[3] = TextDrawCreate(50.864700, 178.433334, "Tele_2");
TextDrawLetterSize(TeleMenu_p1[3], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p1[3], 3);
TextDrawColor(TeleMenu_p1[3], 16777215);
TextDrawSetShadow(TeleMenu_p1[3], 0);
TextDrawSetOutline(TeleMenu_p1[3], 0);
TextDrawBackgroundColor(TeleMenu_p1[3], 255);
TextDrawFont(TeleMenu_p1[3], 3);
TextDrawSetProportional(TeleMenu_p1[3], 1);
TextDrawSetShadow(TeleMenu_p1[3], 0);
TextDrawSetSelectable(TeleMenu_p1[3], true);
TeleMenu_p1[4] = TextDrawCreate(50.864700, 197.333206, "Tele_3");
TextDrawLetterSize(TeleMenu_p1[4], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p1[4], 3);
TextDrawColor(TeleMenu_p1[4], 16777215);
TextDrawSetShadow(TeleMenu_p1[4], 0);
TextDrawSetOutline(TeleMenu_p1[4], 0);
TextDrawBackgroundColor(TeleMenu_p1[4], 255);
TextDrawFont(TeleMenu_p1[4], 3);
TextDrawSetProportional(TeleMenu_p1[4], 1);
TextDrawSetShadow(TeleMenu_p1[4], 0);
TextDrawSetSelectable(TeleMenu_p1[4], true);
TeleMenu_p1[5] = TextDrawCreate(26.700004, 240.750015, "Proximo");
TextDrawLetterSize(TeleMenu_p1[5], 0.306352, 1.529999);
TextDrawAlignment(TeleMenu_p1[5], 2);
TextDrawColor(TeleMenu_p1[5], -1);
TextDrawSetShadow(TeleMenu_p1[5], 0);
TextDrawSetOutline(TeleMenu_p1[5], 0);
TextDrawBackgroundColor(TeleMenu_p1[5], 255);
TextDrawFont(TeleMenu_p1[5], 1);
TextDrawSetProportional(TeleMenu_p1[5], 1);
TextDrawSetShadow(TeleMenu_p1[5], 0);
TextDrawSetSelectable(TeleMenu_p1[5], true);
TeleMenu_p1[6] = TextDrawCreate(69.900062, 240.750015, "Sair");
TextDrawLetterSize(TeleMenu_p1[6], 0.306352, 1.529999);
TextDrawAlignment(TeleMenu_p1[6], 1);
TextDrawColor(TeleMenu_p1[6], -1);
TextDrawSetShadow(TeleMenu_p1[6], 0);
TextDrawSetOutline(TeleMenu_p1[6], 0);
TextDrawBackgroundColor(TeleMenu_p1[6], 255);
TextDrawFont(TeleMenu_p1[6], 1);
TextDrawSetProportional(TeleMenu_p1[6], 1);
TextDrawSetShadow(TeleMenu_p1[6], 0);
TextDrawSetSelectable(TeleMenu_p1[6], true);
//------------------------------TeleMenu_p2--------------------------------------
TeleMenu_p2[0] = TextDrawCreate(100.929275, 136.916687, "_");
TextDrawLetterSize(TeleMenu_p2[0], 0.538352, 13.243330);
TextDrawTextSize(TeleMenu_p2[0], -1709.600341, 0.000000);
TextDrawAlignment(TeleMenu_p2[0], 3);
TextDrawColor(TeleMenu_p2[0], 151);
TextDrawUseBox(TeleMenu_p2[0], 1);
TextDrawBoxColor(TeleMenu_p2[0], -16777142);
TextDrawSetShadow(TeleMenu_p2[0], 0);
TextDrawSetOutline(TeleMenu_p2[0], 0);
TextDrawBackgroundColor(TeleMenu_p2[0], -16776961);
TextDrawFont(TeleMenu_p2[0], 1);
TextDrawSetProportional(TeleMenu_p2[0], 1);
TextDrawSetShadow(TeleMenu_p2[0], 0);
TeleMenu_p2[1] = TextDrawCreate(96.782493, 137.066543, "TELEPORT");
TextDrawLetterSize(TeleMenu_p2[1], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p2[1], 3);
TextDrawColor(TeleMenu_p2[1], -1);
TextDrawSetShadow(TeleMenu_p2[1], 0);
TextDrawSetOutline(TeleMenu_p2[1], 3);
TextDrawBackgroundColor(TeleMenu_p2[1], 255);
TextDrawFont(TeleMenu_p2[1], 2);
TextDrawSetProportional(TeleMenu_p2[1], 1);
TextDrawSetShadow(TeleMenu_p2[1], 0);
TeleMenu_p2[2] = TextDrawCreate(50.864700, 160.433456, "Tele_4");
TextDrawLetterSize(TeleMenu_p2[2], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p2[2], 3);
TextDrawColor(TeleMenu_p2[2], 16777215);
TextDrawSetShadow(TeleMenu_p2[2], 0);
TextDrawSetOutline(TeleMenu_p2[2], 0);
TextDrawBackgroundColor(TeleMenu_p2[2], 255);
TextDrawFont(TeleMenu_p2[2], 3);
TextDrawSetProportional(TeleMenu_p2[2], 1);
TextDrawSetShadow(TeleMenu_p2[2], 0);
TextDrawSetSelectable(TeleMenu_p2[2], true);
TeleMenu_p2[3] = TextDrawCreate(50.864700, 178.433334, "Tele_5");
TextDrawLetterSize(TeleMenu_p2[3], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p2[3], 3);
TextDrawColor(TeleMenu_p2[3], 16777215);
TextDrawSetShadow(TeleMenu_p2[3], 0);
TextDrawSetOutline(TeleMenu_p2[3], 0);
TextDrawBackgroundColor(TeleMenu_p2[3], 255);
TextDrawFont(TeleMenu_p2[3], 3);
TextDrawSetProportional(TeleMenu_p2[3], 1);
TextDrawSetShadow(TeleMenu_p2[3], 0);
TextDrawSetSelectable(TeleMenu_p2[3], true);
TeleMenu_p2[4] = TextDrawCreate(50.864700, 197.333206, "Tele_6");
TextDrawLetterSize(TeleMenu_p2[4], 0.400000, 1.600000);
TextDrawAlignment(TeleMenu_p2[4], 3);
TextDrawColor(TeleMenu_p2[4], 16777215);
TextDrawSetShadow(TeleMenu_p2[4], 0);
TextDrawSetOutline(TeleMenu_p2[4], 0);
TextDrawBackgroundColor(TeleMenu_p2[4], 255);
TextDrawFont(TeleMenu_p2[4], 3);
TextDrawSetProportional(TeleMenu_p2[4], 1);
TextDrawSetShadow(TeleMenu_p2[4], 0);
TextDrawSetSelectable(TeleMenu_p2[4], true);
TeleMenu_p2[5] = TextDrawCreate(26.700004, 240.750015, "Voltar");
TextDrawLetterSize(TeleMenu_p2[5], 0.306351, 1.529999);
TextDrawAlignment(TeleMenu_p2[5], 2);
TextDrawColor(TeleMenu_p2[5], -1);
TextDrawSetShadow(TeleMenu_p2[5], 0);
TextDrawSetOutline(TeleMenu_p2[5], 0);
TextDrawBackgroundColor(TeleMenu_p2[5], 255);
TextDrawFont(TeleMenu_p2[5], 1);
TextDrawSetProportional(TeleMenu_p2[5], 1);
TextDrawSetShadow(TeleMenu_p2[5], 0);
TextDrawSetSelectable(TeleMenu_p2[5], true);
TeleMenu_p2[6] = TextDrawCreate(74.776435, 241.199981, "Sair");
TextDrawLetterSize(TeleMenu_p2[6], 0.306351, 1.529999);
TextDrawAlignment(TeleMenu_p2[6], 1);
TextDrawColor(TeleMenu_p2[6], -1);
TextDrawSetShadow(TeleMenu_p2[6], 0);
TextDrawSetOutline(TeleMenu_p2[6], 0);
TextDrawBackgroundColor(TeleMenu_p2[6], 255);
TextDrawFont(TeleMenu_p2[6], 1);
TextDrawSetProportional(TeleMenu_p2[6], 1);
TextDrawSetShadow(TeleMenu_p2[6], 0);
TextDrawSetSelectable(TeleMenu_p2[6], true);
return 1;
}
public OnFilterScriptExit()
{
// PAGE 1
TextDrawDestroy(TeleMenu_p1[0]);
TextDrawDestroy(TeleMenu_p1[1]);
TextDrawDestroy(TeleMenu_p1[2]);
TextDrawDestroy(TeleMenu_p1[3]);
TextDrawDestroy(TeleMenu_p1[4]);
TextDrawDestroy(TeleMenu_p1[5]);
TextDrawDestroy(TeleMenu_p1[6]);
// PAGE 2
TextDrawDestroy(TeleMenu_p2[0]);
TextDrawDestroy(TeleMenu_p2[1]);
TextDrawDestroy(TeleMenu_p2[2]);
TextDrawDestroy(TeleMenu_p2[3]);
TextDrawDestroy(TeleMenu_p2[4]);
TextDrawDestroy(TeleMenu_p2[5]);
TextDrawDestroy(TeleMenu_p2[6]);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/teleport", cmdtext, true))
{
TextDrawShowForPlayer(playerid, TeleMenu_p1[0]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[1]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[2]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[3]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[4]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[5]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[6]);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}
return 0;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != 65535)
{
//------------------------------TeleMenu_p1--------------------------------------
if(clickedid == TeleMenu_p1[2])
{
SetPlayerPos(playerid, 1688.7990, 1500.7753, 10.7675);
SetPlayerFacingAngle(playerid, 267.3902);
SendClientMessage(playerid, -1, "Tele 1");
}
else if(clickedid == TeleMenu_p1[3])
{
SetPlayerPos(playerid, 1630.2030,-2328.9673,13.5469);
SetPlayerFacingAngle(playerid, 0.9392);
SendClientMessage(playerid, -1, "Tele 2");
}
else if(clickedid == TeleMenu_p1[4])
{
SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484);
SetPlayerFacingAngle(playerid, 134.9570);
SendClientMessage(playerid, -1, "Tele 3");
}
else if(clickedid == TeleMenu_p1[5])
{
TextDrawShowForPlayer(playerid, TeleMenu_p2[0]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[1]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[2]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[3]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[4]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[5]);
TextDrawShowForPlayer(playerid, TeleMenu_p2[6]);
SelectTextDraw(playerid, 0xA3B4C5FF);
SendClientMessage(playerid, -1, "Proximo MENU");
}
else if(clickedid == TeleMenu_p1[6])
{
SendClientMessage(playerid, -1, "Saiu do MENU");
}
//------------------------------TeleMenu_p2--------------------------------------
if(clickedid == TeleMenu_p2[2])
{
SetPlayerPos(playerid, 1688.7990, 1500.7753, 10.7675);
SetPlayerFacingAngle(playerid, 267.3902);
SendClientMessage(playerid, -1, "Tele 1");
}
else if(clickedid == TeleMenu_p2[3])
{
SetPlayerPos(playerid, 1630.2030,-2328.9673,13.5469);
SetPlayerFacingAngle(playerid, 0.9392);
SendClientMessage(playerid, -1, "Tele 2");
}
else if(clickedid == TeleMenu_p2[4])
{
SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484);
SetPlayerFacingAngle(playerid, 134.9570);
SendClientMessage(playerid, -1, "Tele 3");
}
else if(clickedid == TeleMenu_p2[5])
{
TextDrawShowForPlayer(playerid, TeleMenu_p1[0]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[1]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[2]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[3]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[4]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[5]);
TextDrawShowForPlayer(playerid, TeleMenu_p1[6]);
SelectTextDraw(playerid, 0xA3B4C5FF);
SendClientMessage(playerid, -1, "Voltou ao MENU");
}
else if(clickedid == TeleMenu_p2[6])
{
SendClientMessage(playerid, -1, "Saiu do MENU");
}
//-------------------PAGE 1
TextDrawHideForPlayer(playerid, TeleMenu_p1[0]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[1]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[2]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[3]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[4]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[5]);
TextDrawHideForPlayer(playerid, TeleMenu_p1[6]);
CancelSelectTextDraw(playerid);
//-------------------PAGE 2
TextDrawHideForPlayer(playerid, TeleMenu_p2[0]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[1]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[2]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[3]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[4]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[5]);
TextDrawHideForPlayer(playerid, TeleMenu_p2[6]);
}
return 1;
}