02.08.2016, 00:41
Hi,I have a litte problem whit a 3DTextLabel.
The problem is that:
• This a code to buy a fuel station
• In OnGameModeInIt I have a
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?
Sorry for my english but I'm Italian boy
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; } |
Quote:
mylabel = Create3DTextLabel(.......); |
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); } |