27.01.2015, 14:57
(
Последний раз редактировалось kapazul; 27.01.2015 в 18:42.
)
Boas Tardes pessoal estou com dificuldade em esconder estas textdraws, visto que estгo num sistema de casas no qual so consigo usar a variбvel (i) e nгo consigo usar o playerid, o problema esta quando tento usar OnPlayerClickTextDraw para usar o botгo de "cancelar" ele nгo me deixa usar a variavel (i) logo ele nгo funciona quando tento fechar. Alguma sugestгo para solucionar o problema?
PHP код:
public PickupGametexts()
{
new string[500];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gPlayerLogged[i])
{
//=============================================[BUILDING GAMETEXTS]==========================================
//=========================================================================================================
//======================================[HOUSE GAMETEXTS]===================================================
for(new n = 0; n < sizeof(Houses); n++)
{
if (PlayerToPoint(1.0, i,Houses[n][EnterX], Houses[n][EnterY], Houses[n][EnterZ]))
{
if(Houses[n][HousePrice] != 0) //Only show the house if price is set
{
if(Houses[n][Owned] == 0)
{
new casaaid[60];
new caguistos[60];
new estadocasa[70];
new houselocation[MAX_ZONE_NAME];
GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], houselocation, MAX_ZONE_NAME);
/* format(string, sizeof(string), "~g~Esta casa esta para venda!~n~~w~Morada: ~y~ %d %s~n~~w~Descricao: ~y~%s ~n~~w~Preco: ~y~%d euros~n~",n,houselocation,Houses[n][Description],Houses[n][HousePrice]); */
format(casaaid,sizeof(casaaid),"%d", n);
format(caguistos,sizeof(caguistos),"%d", Houses[n][HousePrice]);
format(estadocasa,sizeof(estadocasa),"Para Venda");
GameTextForPlayer(i, string, 3500, 3);
TextDrawShowForPlayer(i, Cbox1);
TextDrawShowForPlayer(i, Cbox2);
TextDrawShowForPlayer(i, Cbox3);
TextDrawShowForPlayer(i, Cbox4);
TextDrawShowForPlayer(i, Cbox5);
TextDrawShowForPlayer(i, Cacomprar);
TextDrawShowForPlayer(i, Cacancelar);
TextDrawShowForPlayer(i, Cadescritivo);
TextDrawShowForPlayer(i, Cacomprar);
TextDrawShowForPlayer(i, Capreco);
TextDrawShowForPlayer(i, Caid);
TextDrawShowForPlayer(i, Camorada);
TextDrawShowForPlayer(i, Cainfos);
TextDrawShowForPlayer(i, Caboxmeio);
TextDrawShowForPlayer(i, Calocalidade);
TextDrawShowForPlayer(i, Caparavenda);
TextDrawShowForPlayer(i, Caestado);
TextDrawShowForPlayer(i, Canumid);
TextDrawShowForPlayer(i, Cadin);
TextDrawShowForPlayer(i, Cadescritivo);
TextDrawShowForPlayer(i, Cadescricao);
SelectTextDraw(i, 0x00FF00FF);
TextDrawSetString(Canumid, casaaid);
TextDrawSetString(Caestado, estadocasa);
TextDrawSetString(Calocalidade, houselocation);
TextDrawSetString(Cadescricao, Houses[n][Description]);
TextDrawSetString(Cadin, caguistos);
TextDrawSetSelectable(Cacomprar, true);
TextDrawSetSelectable(Cacancelar, true);
}