17.03.2011, 18:21
Boas, eu tenho um sistema de casas e de negуcios, mas ambos nao aparecem os "textdraws" no jogo.
Aqui deixo o cуdigo:
( e ainda continua, mas sao textdraws relacionados com a gasolina e isso..
sу esta parte й que nao funciona no jogo, podiam-me ajudar ?
Aqui deixo o cуdigo:
pawn Код:
public PickupGametexts()
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, oldposx, oldposy, oldposz);
if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
{
//=============================================[BUILDING GAMETEXTS]==========================================
for(new h = 0; h < sizeof(Building); h++)
{
if (PlayerToPoint(1.0, i,Building[h][EnterX], Building[h][EnterY], Building[h][EnterZ]))
{
if(GetPlayerCash(i) >= Building[h][EntranceFee])
{
if(Building[h][EntranceFee] > 1)
{
format(string, sizeof(string), "%s~n~~w~Preзo de entrada: ~g~$%d",Building[h][BuildingName],Building[h][EntranceFee]);
GameTextForPlayer(i, string, 3500, 3);
}
else
{
format(string, sizeof(string), "%s",Building[h][BuildingName]);
GameTextForPlayer(i, string, 3500, 3);
}
}
else
{
if(Building[h][EntranceFee] > 1)
{
format(string, sizeof(string), "%s~n~~w~Preзo de entrada: ~r~$%d",Building[h][BuildingName],Building[h][EntranceFee]);
GameTextForPlayer(i, string, 3500, 3);
}
else
{
format(string, sizeof(string), "%s",Building[h][BuildingName]);
GameTextForPlayer(i, string, 3500, 3);
}
}
}
}
//=========================================================================================================
//======================================[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 houselocation[MAX_ZONE_NAME];
GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], houselocation, MAX_ZONE_NAME);
format(string, sizeof(string), "~g~Esta casa esta a venda!~n~~w~Morada: ~y~ %d %s~n~~w~Descricao: ~y~%s ~n~~w~Preco: ~y~%d$~n~",n,houselocation,Houses[n][Description],Houses[n][HousePrice]);
GameTextForPlayer(i, string, 3500, 3);
}
else
{
if(Houses[n][Rentable] == 1)
{
new houselocation[MAX_ZONE_NAME];
GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], houselocation, MAX_ZONE_NAME);
format(string, sizeof(string), "~w~Morada: ~y~%d %s~n~~w~Proprietario: ~y~%s ~n~~w~Descricao: ~y~%s~n~~w~Preco de aluger: ~y~$%d",n,houselocation,Houses[n][Owner],Houses[n][Description],Houses[n][RentCost]);
GameTextForPlayer(i, string, 3500, 3);
}
else
{
new houselocation[MAX_ZONE_NAME];
GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], houselocation, MAX_ZONE_NAME);
format(string, sizeof(string), "~w~Morada: ~y~%d %s~n~~w~Proprietario: ~y~%s ~n~~w~Descricao: ~y~%s",n,houselocation,Houses[n][Owner],Houses[n][Description]);
GameTextForPlayer(i, string, 3500, 3);
}
}
}
}
}
//=======================================[BUSINESS GAMETEXTS]=========================================================
for(new n = 0; n < sizeof(Businesses); n++)
{
if (PlayerToPoint(1.0, i,Businesses[n][EnterX], Businesses[n][EnterY], Businesses[n][EnterZ]))
{
new businesstype[128];
if(Businesses[n][BizType] != 0)
{
if(Businesses[n][BizType] == 1) { businesstype = "Restaurante"; }
else if(Businesses[n][BizType] == 2) { businesstype = "Empresa Telefonica"; }
else if(Businesses[n][BizType] == 3) { businesstype = "Loja 24-7"; }
else if(Businesses[n][BizType] == 4) { businesstype = "Loja de armas"; }
else if(Businesses[n][BizType] == 5) { businesstype = "Empresa de Anuncios"; }
else if(Businesses[n][BizType] == 6) { businesstype = "Loja de Roupa"; }
else if(Businesses[n][BizType] == 7) { businesstype = "Bar/Discoteca"; }
else if(Businesses[n][BizType] == 8) { businesstype = "Sex Shop"; }
else if(Businesses[n][BizType] == 9) { businesstype = "Supermercado"; }
else if(Businesses[n][BizType] == 10) { businesstype = "Universidade"; }
else if(Businesses[n][BizType] == 11) { businesstype = "Campismo"; }
else if(Businesses[n][BizType] == 12) { businesstype = "Loja de Tuning"; }
}
else { businesstype = "Entertetimento"; }
if(Businesses[n][BizPrice] != 0) //Only show the business if price is set
{
if(Businesses[n][Owned] == 0)
{
format(string, sizeof(string), "~g~Este negocio esta a venda!~n~~w~Nome: ~y~%s ~n~~w~Tipo: ~y~%s ~n~~w~Preco: ~y~$%d",Businesses[n][BusinessName],businesstype,Businesses[n][BizPrice]);
GameTextForPlayer(i, string, 3500, 3);
}
else
{
format(string, sizeof(string), "~w~Nome: ~y~%s ~n~~w~Tipo: ~y~%s ~n~~w~Proprietario: ~y~%s~n~~w~Preco de entrada: ~y~$%d",Businesses[n][BusinessName],businesstype,Businesses[n][Owner],Businesses[n][EntranceCost]);
GameTextForPlayer(i, string, 3500, 3);
}
}
}
}
sу esta parte й que nao funciona no jogo, podiam-me ajudar ?