[POMOC] 3DTextLabel


Započeo Snich, Jul 30, 2011, 22:39:59 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Snich

Skripta koju koristim: FactionGame RolePlay
Detaljan opis problema: Imam problem sa 3DText-ovima na kucama, nece nikako da se update-uju nakon kupovine ili prodaje, znaci kada kucam /buyhouse novi 3DText se samo sastavi sa prijasnjim Textom, svasta sam pravio, ali jednostavno, textovi se samo poklapaju, znaci ja zelim kada otkucam komandu /sellhouse da izbaci samo text (Kuca je na prodaju, Cijena kuce je ...itd... ) , a kada kucam /buyhouse da izbaci (Vlasnik kuce je ...itd... ), a sada mi se oba texta poklapaju bilo da prodam ili kupujem kucu  :-\
Dio skripte:
       for(new h = 0; h < sizeof(HouseInfo); h++)
	{
		if(HouseInfo[h][hOwned] == 0)
		{
			format(PropertyString, sizeof(PropertyString), "Ova kuca/stan je na prodaju !! \n Opis %s \n Cijena kuce iznosi %d \n Potreban level %d \n Da kupite ovu kucu/stan, kucajte \n /buyhouse",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
			kucanaprodaju = Create3DTextLabel(PropertyString,0x00FF00AA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,70,0,1);
		}
		if(HouseInfo[h][hOwned] == 1)
		{
			format(PropertyString, sizeof(PropertyString), "Vlasnik ove kuce/stana je\n %s \n Level %d \n Da rentate, kucajte \n /rentroom",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
			kupljenakuca = Create3DTextLabel(PropertyString,0xFFFFFFAA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,70,0,1);
		}
	}
	for(new h = 0; h < sizeof(BizzInfo); h++)
	{
		if(BizzInfo[h][bOwned] == 0)
		{
			format(PropertyString, sizeof(PropertyString), "[Prodaja]\n$ %d",BizzInfo[h][bBuyPrice]);
			bizsale = Create3DTextLabel(PropertyString,0x8361FFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1,15,0,1);
			AddStaticPickup(1272, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
			pickups++;
		}
		if(BizzInfo[h][bOwned] == 1)
		{
			format(PropertyString, sizeof(PropertyString), "[OWNED BY]\n%s",BizzInfo[h][bOwner]);
			Create3DTextLabel(PropertyString,0x8361FFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1,15,0,1);
			AddStaticPickup(1239, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
			pickups++;
		}
	}
	for(new h = 0; h < sizeof(SBizzInfo); h++)
	{
		if(SBizzInfo[h][sbOwned] == 0)
		{
			format(PropertyString, sizeof(PropertyString), "[Prodaja]\n$ %d",SBizzInfo[h][sbBuyPrice]);
			sbizsale = Create3DTextLabel(PropertyString,0x8361FFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1,15,0,1);
			AddStaticPickup(1272, 2, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
			pickups++;
		}
		if(SBizzInfo[h][sbOwned] == 1)
		{
			format(PropertyString, sizeof(PropertyString), "[OWNED BY]\n%s",SBizzInfo[h][sbOwner]);
			Create3DTextLabel(PropertyString,0x8361FFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1,15,0,1);
			AddStaticPickup(1239, 2, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
			pickups++;
		}
	}


KOMANDA (sellhouse): 
                     
if(strcmp(cmd, "/sellhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			GetPlayerName(playerid, playername, sizeof(playername));
			if(PlayerInfo[playerid][pPhousekey] == 255)
			{
				SendClientMessage(playerid, COLOR_WHITE, "Ne posjedujete kucu.");
				return 1;
			}
			if(PlayerInfo[playerid][pMarried] > 0)
  			{
    			SendClientMessage(playerid, COLOR_GREY, "   Vjencani ste, ne mozete prodati kucu !");
      			return 1;
    		}
			if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
			{
				new house = PlayerInfo[playerid][pPhousekey];
				HouseInfo[house][hHel] = 0;
				HouseInfo[house][hArm] = 0;
				HouseInfo[house][hHealthx] = 0;
				HouseInfo[house][hHealthy] = 0;
				HouseInfo[house][hHealthz] = 0;
				HouseInfo[house][hArmourx] = 0;
				HouseInfo[house][hArmoury] = 0;
				HouseInfo[house][hArmourz] = 0;
				HouseInfo[house][hLock] = 1;
				HouseInfo[house][hOwned] = 0;
				HouseInfo[house][hVec] = 418;
				HouseInfo[house][hVcol1] = -1;
				HouseInfo[house][hVcol2] = -1;
				GetPlayerName(playerid, sendername, sizeof(sendername));
				strmid(HouseInfo[house][hOwner], "Drzava", 0, strlen("Drzava"), 255);
				SafeJB_GivePlayerMoney(playerid,HouseInfo[house][hValue]);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				format(string, sizeof(string), "~w~Cestitamo~n~ Prodali ste kucu za ~n~~g~$%d", HouseInfo[house][hValue]);
				Delete3DTextLabel(kupljenakuca);
				GameTextForPlayer(playerid, string, 10000, 3);
				PlayerInfo[playerid][pPhousekey] = 255;
				if(PlayerInfo[playerid][pLocal] == house)
				{
					SetPlayerInterior(playerid,0);
					SetPlayerVirtualWorld(playerid,0);
					SetPlayerPos(playerid,HouseInfo[house][hEntrancex],HouseInfo[house][hEntrancey],HouseInfo[house][hEntrancez]);
					PlayerInfo[playerid][pInt] = 0;
				}
				OnPropUpdate();
				OnPlayerUpdateCustom(playerid);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_WHITE, "Ne posjedujete kucu.");
			}
		}
		return 1;
	}


KOMANDA: (buyhouse)
                                     
if(strcmp(cmd, "/buyhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			for(new h = 0; h < sizeof(HouseInfo); h++)
			{
				if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
					{
						format(string, sizeof(string), "   Morate biit Level %d da biste kupili ovo !", HouseInfo[h][hLevel]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
					{
						SendClientMessage(playerid, COLOR_WHITE, "   Vec posjedujete kucu, kucajte /sellhouse ako zelite da kupite ovu !");
						return 1;
					}
					if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
					{
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						SafeJB_GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
						/*SetPlayerInterior(playerid,HouseInfo[h][hInt]);
						SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
						SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);*/
						GameTextForPlayer(playerid, "~w~Dobrodosli Kuci~n~Mozete uvjek izaci tako sto cete doci do ulaznih vrata i kucati /exit", 5000, 3);
						PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
						PlayerInfo[playerid][pLocal] = h;
						SendClientMessage(playerid, COLOR_RED, "INFO: 3DText na vasoj kuci/stanu ce se Update-ovati nakon restarta servera !");
						SendClientMessage(playerid, COLOR_WHITE, "Cestitamo vam na kupovini nove kuce !");
						SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da biste dobili pomoc vezanu za kucu !");
      					Delete3DTextLabel(Text3D:kucanaprodaju);
      					format(PropertyString, sizeof(PropertyString), "Vlasnik ove kuce/stana je\n %s \n Level %d \n Da rentate, kucajte \n /rentroom",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
						kupljenakuca = Create3DTextLabel(PropertyString,0xFFFFFFAA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,70,0,1);
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateCustom(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovoljno novca za kupovinu !");
						return 1;
					}
				}
			}
		}
		return 1;
	}

             
Neke slike/video za lakse dobivanje pomoci(neobavezno): 

K4[Я]!K3

*

'Respect cannot be learned, it can only be earned.'

Kod: c
Update3DTextLabelText(ime_labela, boja, "updateeeeee");

Snich

Citat: K4[Я]!K3.dupLex poslato Jul 30, 2011, 22:55:00 POSLE PODNE
Kod: c
Update3DTextLabelText(ime_labela, boja, "updateeeeee");


Pokusao, isti shit  :-\

Kod: c
Delete3DTextLabel(kucanaprodaju[id]);

Snich

Citat: [TG]$--L84S--$ poslato Avgust 01, 2011, 15:55:15 POSLE PODNE
Kod: c
Delete3DTextLabel(kucanaprodaju[id]);


Ne funkcionise, tako mi je sad trenutno ..  :-\

Zar nije jednostavnije...
OnGameModeInit - Staviš početni textdraw ovako kako je sada znači da kreira 3DText i pod neki timer napraviš checker da update-a 3DText znači kada se kupi/proda da se update-a sam 3DText
Kristijan Stipić