public CustomPickups()
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new string[128];
NameTimer();
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, oldposx, oldposy, oldposz);
new tmpcar = GetPlayerVehicleID(i);
if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
{
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos requeridos~w~: %d~n~~y~Preњo por Produto: ~w~: R$ %d ~n~~g~Fundos: ~w~: R$ %d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "~w~%s~w~~n~dono : %s~n~extorsљo : %s~n~taxa: ~g~R$ %d ~w~Level: %d ~n~entrada /entrar",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
}
else
{
format(string, sizeof(string), "~w~%s~w~~n~a empresa estЃ a venda~n~preњo: ~g~R$ %d ~w~Level : %d ~n~para comprar a empresa: /comprarempresa",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(string, sizeof(string), "~w~proprietЃrio da casa:~n~%s~n~Level : %d",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
}
else
{
format(string, sizeof(string), "~w~proprietЃrio da casa:~n~%s~n~Aluguel: R$ %d Level : %d~n~digite /alugarquarto para alugar um quarto",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
else
{
format(string, sizeof(string), "~w~a casa estЃ a venda~n~Descriњљo: %s ~n~Preњo: ~g~R$ %d ~n~~w~ Level : %d~n~para comprar digite /comprarcasa",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
}
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos Requeridos~w~: %d~n~~y~Preњo por Produto: ~w~: R$ %d ~n~~g~Fundos: ~w~: R$ %d",BizzInfo[h][bMessage],(BizzInfo[h][bMaxProducts]-BizzInfo[h][bProducts]),BizzInfo[h][bPriceProd],BizzInfo[h][bTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(PlayerToPoint(2.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "~w~%s~w~~n~DONO: %s~n~extorsљo: %s~n~taxa : ~g~R$ %d ~w~Level : %d ~n~use /entrar",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
}
else
{
format(string, sizeof(string), "~w~%s~w~~n~a empresa estЃ a venda~n~Preњo: ~g~R$ %d ~w~Level : %d ~n~para comprar a empresa /comprarempresa",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
}
Facil? Um scripter me ajudou arrumar eu realmente achei que arrumou, mais nгo arrumou, tentei fazer muitas coisas e nгo consegui, й realmente algo muito dificil pra mim, e cada vez que continuo editando fico irritado, eu realmente crio tуpicos para pedir ajuda..
|
// Coloque o cуdigo abaixo nesta public OnGameModeInit()
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(string, sizeof(string), "~w~proprietЃrio da casa:~n~%s~n~Level : %d",HouseInfo[h] [hOwner],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COR,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
//Create3DTextLabel(texto[],cor,coord: X,coord:Y,coord,Z,distancia mбxima que pode vizualizar o texto,virtual world,se podemos ver o texto atraves de objetos);
//mais detalhes sobre esta funзгo procura na sa-mp wiki
}
else if(HouseInfo[h][hRentabil] == 1)
{
format(string, sizeof(string), "~w~proprietЃrio da casa:~n~%s~n~Aluguel: R$ %d Level : %d~n~digite /alugarquarto para alugar um quarto",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COR,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
else if(HouseInfo[h][hOwned] == 0)
{
format(string, sizeof(string), "~w~a casa estЃ a venda~n~Descriњљo: %s ~n~Preњo: ~g~R$ %d ~n~~w~ Level : %d~n~para comprar digite /comprarcasa",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COR,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
Aqui й apenas trocar para nгo precisar estar encima da PICKUP e colocar o texto em Label..
|
if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ])) // retire essa linha tambйm
public CustomPickups()
{
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);
new tmpcar = GetPlayerVehicleID(i);
if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
{
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos Requeridos:~w~%d~n~w~Preco por Produto: ~r~R$%d~n~~g~Fundos: ~w~R$%d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "%s\nProprietбrio: %s\nSуcio/Extorзгo: %s\nTaxa de Entrada:R$%d\nLevel: %d\nEntrada /entrar",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
Create3DTextLabel(string, COLOR_WHITE, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],60,0,1);
}
if(SBizzInfo[h][sbOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d\nLevel: %d \nComprar /comprarempresa",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
Create3DTextLabel(string, COLOR_WHITE, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],60,0,1);
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(string, sizeof(string), "Proprietбrio da Casa: %s\nLevel: %d",HouseInfo[h] [hOwner],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
//Create3DTextLabel(texto[],cor,coord: X,coord:Y,coord,Z,distancia mбxima que pode vizualizar o texto,virtual world,se podemos ver o texto atraves de objetos);
//mais detalhes sobre esta funзгo procura na sa-mp wiki
}
else if(HouseInfo[h][hRentabil] == 1)
{
format(string, sizeof(string), "Proprietбrio da Casa: %s\nAluguel: R$%d - Level: %d\nPara /alugarquarto",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
else if(HouseInfo[h][hOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d - Level : %d\nPara /comprarcasa",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos Requeridos:~w~%d~n~w~Preco por Produto: ~r~R$%d~n~~g~Fundos: ~w~R$%d",BizzInfo[h][bMessage],(BizzInfo[h][bMaxProducts]-BizzInfo[h][bProducts]),BizzInfo[h][bPriceProd],BizzInfo[h][bTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "%s\nProprietбrio: %s\nSуcio: %s\nTaxa de Entrada:R$%d - Level: %d\nPara /entrar",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
Create3DTextLabel(string, COLOR_WHITE, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15,0);
}
if(BizzInfo[h][bOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d - Level: %d \nPara /comprarempresa",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
Create3DTextLabel(string, COLOR_WHITE, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15,0);
}
return 1;
}
}