Problem Whit 3DTextLabel
#1

Hi,I have a litte problem whit a 3DTextLabel.

The problem is that:


• This a code to buy a fuel station

Quote:

CMD:buyfuelstation(playerid, params[])
{
new str4[128], stringa[128];
new id = IsPlayerNearBenzEnt(playerid);

if(id == -1 || id == 0) return SCM(playerid, COMANDO_USARE, "Non sei in un pompa benzina");

if(BenzinaioInfo[id][bOwned] != 0 || BenzinaioInfo[id][bPrice] == 0) return SCM(playerid, COMANDO_USARE, "Pompa benzina non in vendita");

if(PlayerInfo[playerid][pBenzinaio] != 0) return SCM(playerid, ROSSO, "Hai giа una pompa benzina");

if(PlayerInfo[playerid][pCash] < BenzinaioInfo[id][bPrice]) return SCM(playerid, ROSSO, "Spiacenti, non hai abbastanza soldi.");

PlayerInfo[playerid][pBenzinaio] = id;
PlayerInfo[playerid][pCash] -= BenzinaioInfo[id][bPrice];
GivePlayerMoney(playerid, -BenzinaioInfo[id][bPrice]);
BenzinaioInfo[id][bLocked] = 0;
BenzinaioInfo[id][bOwned] = 1;
BenzinaioInfo[id][bOwner] = RemoveUnderScore(playerid);
SalvaBenzinaio(id);
Salvataggio(playerid);
Delete3DTextLabel(mylabel);
format(str4, sizeof(str4), BENZPATH, id);//formats the file path, with the biz ID
INI_ParseFile(str4, "loadbenz_%s", .bExtra = true, .extra = id );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
//CreateDynamicPickup(1274, 1, BenzinaioInfo[id][bEntranceX], BenzinaioInfo[id][bEntranceY], BenzinaioInfo[id][bEntranceZ], 0); //Creates a pickup at the business entrance.
if(BenzinaioInfo[id][bOwned] == 1)
{
format(stringa,sizeof(stringa), "Pompa benzina di: %s\nPrezzo al litro: 1.7$",BenzinaioInfo[id][bOwner]);
mylabel = Create3DTextLabel(stringa, 0x008080FF, BenzinaioInfo[id][bEntranceX], BenzinaioInfo[id][bEntranceY], BenzinaioInfo[id][bEntranceZ], 40.0, 0, 0);
}
else
{
format(stringa,sizeof(stringa), "Pompa benzina dello stato\n%d$ per acquistarla\nPrezzo al litro: 1.70$",BenzinaioInfo[id][bPrice]);
mylabel = Create3DTextLabel(stringa, 0x008080FF, BenzinaioInfo[id][bEntranceX], BenzinaioInfo[id][bEntranceY], BenzinaioInfo[id][bEntranceZ], 40.0, 0, 0);
}
return 1;
}
• In OnGameModeInIt I have a
Quote:

mylabel = Create3DTextLabel(.......);

And if the fuel station has a Owner the 3dTextLabel is a one, else if another text..

But, when I buy a fuelstation, how do to change a text of 3dtextlabel?

Quote:

if(BenzinaioInfo[idx6][bOwned] == 1)
{
format(stringa,sizeof(stringa), "Pompa benzina di: %s\nPrezzo al litro: 1.7$",BenzinaioInfo[idx6][bOwner]);
mylabel = Create3DTextLabel(stringa, 0x008080FF, BenzinaioInfo[idx6][bEntranceX], BenzinaioInfo[idx6][bEntranceY], BenzinaioInfo[idx6][bEntranceZ], 40.0, 0, 0);
}
else
{
format(stringa,sizeof(stringa), "Pompa benzina dello stato\n%d$ per acquistarla\nPrezzo al litro: 1.70$",BenzinaioInfo[idx6][bPrice]);
mylabel = Create3DTextLabel(stringa, 0x008080FF, BenzinaioInfo[idx6][bEntranceX], BenzinaioInfo[idx6][bEntranceY], BenzinaioInfo[idx6][bEntranceZ], 40.0, 0, 0);
}
Sorry for my english but I'm Italian boy
Reply


Messages In This Thread
Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 00:41
Re: Problem Whit 3DTextLabel - by AndySedeyn - 02.08.2016, 00:48
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 00:57
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 01:05
Re: Problem Whit 3DTextLabel - by AndySedeyn - 02.08.2016, 01:07
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 01:12
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 01:14
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 01:16
Re: Problem Whit 3DTextLabel - by AndySedeyn - 02.08.2016, 01:59
Re: Problem Whit 3DTextLabel - by AlexPalermitano97 - 02.08.2016, 11:25

Forum Jump:


Users browsing this thread: 5 Guest(s)