03.10.2012, 18:19
Hi!
I need a little bit of help.
I wanna update 2 3d text labels at once, when someone buys the house.
Here's the labels:
(The label is for houses.)
And here's the command, I want the label to update on:
I need a little bit of help.
I wanna update 2 3d text labels at once, when someone buys the house.
Here's the labels:
pawn Код:
for(new h; h <= KokkuMaju(); h++)
{
new silo[16];
new s[32];
if(HouseInfo[h][hRentable] == 1 ) format(silo,sizeof(silo), "Rendi hind %d",HouseInfo[h][hRent]);
else format(silo,sizeof(silo), " ");
if(HouseInfo[h][hOwned] == 0) format(s, sizeof(s), "Mььgis %d", HouseInfo[h][hValue]);
else format(s, sizeof(s), "Omanik: %s", GetNameFromSql(HouseInfo[h][hOwner]));
format(string, sizeof(string), "%s\n%s\n%s",HouseInfo[h][hDescription],s, silo);
Create3DTextLabel(string,ORANGE,HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ], 30.0, 0);
}
And here's the command, I want the label to update on:
pawn Код:
dcmd_omaja(playerid, params[])
{
#pragma unused params
new State;
new h = PlayerAtHouse(playerid, State, 3.0);
if(h < 1) return SendClientMessage(playerid, COLOR_WHITE, "Sa pole ьhegi maja juures!");
if(HouseInfo[h][hOwned] != 0) return SendClientMessage(playerid, COLOR_WHITE, "See maja pole mььgis!");
if(KasutajaInfo[playerid][pPhousekey] != 255 && HouseInfo[KasutajaInfo[playerid][pPhousekey]][hOwner] == KasutajaInfo[playerid][pSQLID])
{
return SendClientMessage(playerid, COLOR_WHITE, "Sul on juba maja, trьki /mььmaja kui sa tahad mььa toda ja osta seda!");
}
if(KasutajaInfo[playerid][pCash] < HouseInfo[h][hValue]) return SendClientMessage(playerid, COLOR_WHITE, "Pole piisavalt raha!");
KasutajaInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
HouseInfo[h][hOwner] = KasutajaInfo[playerid][pSQLID];
SafeNewGivePlayerMoney(playerid, -(HouseInfo[h][hValue]));
PlayerPlayMusic(playerid);
GameTextForPlayer(playerid, "~w~Teretulemast koju~n~Sa vхid vдljuda igal ajal, liikudes ukse juurde ja trьkkides /vдlju", 5000, 3);
SendEmoteMessage(playerid, "kirjutab lepingule ja vaatab oma uut maja.");
SendClientMessage(playerid, COLOR_WHITE, "Palju хnne uue ostu puhul!!");
SendClientMessage(playerid, COLOR_WHITE, "Trьki /majaabi, et nдha uusi kдsklusi!");
EnterExitHouse(playerid, h, 0, State);
OnGamePlayerUpdate(playerid);
UpdateHouses();
return 1;
}