[Pomoc] Oko kuca i bizeva xD


Započeo Novica, Maj 12, 2012, 14:18:53 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Mod:Moj
Problem:Nema problema samo ako neko moze da mi kaze kako da stavim da pise id kuce i id biza i kako da napravim kada neko kupi biz da se odma promeni 3dtext a ne posle restarta srv-a ? pls pomoc xD
Deo skripte://
Slike/video://
RESPECT FOR MILANCE !

daj komandu za kupnju
i kako ti je definiran 3d text od bizeva i kuca ?

eo /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])
					{
					    Delete3DTextLabel(Text3D:housesale);
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						SafeGivePlayerMoney(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_WHITE, "Cestitamo vam na kupovini nove kuce !");
						SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da biste dobili pomoc vezanu za kucu !");
						Delete3DTextLabel(Text3D:housesale);
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateCustom(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovoljno novca za kupovinu !");
						return 1;
					}
				}
			}
		}
		return 1;
	}

eo i /buybiz
if(strcmp(cmd, "/buybiz", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            if(PlayerInfo[playerid][pPbiskey] != 255)
			{
				SendClientMessage(playerid, COLOR_WHITE, "   Vec posjedujete biznis, kucajte /sellbiz ako zelite da kupite ovaj.");
				return 1;
			}
			for(new b = 0; b < sizeof(SBizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
					{
						format(string, sizeof(string), "Morate biti lvl %d da biste kupili to",SBizzInfo[b][sbLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
					{
					    Delete3DTextLabel(Text3D:sbizsale);
						PlayerInfo[playerid][pPbiskey] = b+100;
						SBizzInfo[b][sbOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
						SafeGivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
						SendClientMessage(playerid, COLOR_WHITE, "Cestitamo vam na novom biznisu.");
						SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da pogledate pomoc oko biznisa.");
						Delete3DTextLabel(Text3D:sbizsale);
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateCustom(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "Nemate dovoljno novca da kupite to");
						return 1;
					}
				}
			}


E sad kako mislis definisan ?
for(new h = 230; h < sizeof(CarInfo); h++)
	{
  AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
	}
	for(new h = 0; h < sizeof(HouseInfo); h++)
	{
		if(HouseInfo[h][hOwned] == 0)
		{
			format(PropertyString,sizeof(PropertyString),"Kuca na Prodaju!\n Cena: $%d \n Opis: %s \n Level: %d",HouseInfo[h][hValue],HouseInfo[h][hDiscription], HouseInfo[h][hLevel]);
			CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 31, 0, -1, -1, -1, 100.0);
			housesale = Create3DTextLabel(PropertyString,0x00FF00AA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
			AddStaticPickup(1273, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
			pickups++;
		}
		if(HouseInfo[h][hOwned] == 1)
		{
			format(PropertyString,sizeof(PropertyString),"Vlasnik %s\n Rent: $%d \n Opis: %s \n Za Rent Koristi /rentroom", HouseInfo[h][hOwner], HouseInfo[h][hRent], HouseInfo[h][hDiscription]);
			CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 32, 0, -1, -1, -1, 100.0);
			Create3DTextLabel(PropertyString,0xFF0000FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
			AddStaticPickup(1272, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
			pickups++;
		}
	}
	for(new h = 0; h < sizeof(BizzInfo); h++)
	{
		if(BizzInfo[h][bOwned] == 0)
		{
			format(PropertyString,sizeof(PropertyString),"Bizz na Prodaju! \n Cena: $%d \n Level: %d \n Na prodaju Koristi, /buybiz", BizzInfo[h][bBuyPrice], BizzInfo[h][bLevelNeeded]);
			bizsale = Create3DTextLabel(PropertyString,0x00FF00AAF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1,15,0,1);
			AddStaticPickup(1274, 2, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
			pickups++;
		}
		if(BizzInfo[h][bOwned] == 1)
		{
            format(PropertyString,sizeof(PropertyString),"%s \n Vlasnik: %s \n Reket: %s \n Naplata ulaza: $%d. \n Za Ulazak Koristi, /enter.",BizzInfo[h][bMessage],BizzInfo[h][bOwner], BizzInfo[h][bExtortion], BizzInfo[h][bEntranceCost]);
			Create3DTextLabel(PropertyString,0x00FFFFAA,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),"Bizz na Prodaju! \n Cena: $%d \n Level: %d \n Za Kupnju Koristi, /buybiz", SBizzInfo[h][sbBuyPrice], SBizzInfo[h][sbLevelNeeded]);
			sbizsale = Create3DTextLabel(PropertyString,0x00FF00AAF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1,15,0,1);
			AddStaticPickup(1274, 2, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
			pickups++;
		}
		if(SBizzInfo[h][sbOwned] == 1)
		{
			format(PropertyString,sizeof(PropertyString),"%s \n Vlasnik: %s \n Reket: %s \n Naplata ulaza: $%d. \n Za Ulazak Koristi, /enter.",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner], SBizzInfo[h][sbExtortion], SBizzInfo[h][sbEntranceCost]);
			Create3DTextLabel(PropertyString,0x00FFFFAA,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++;
		}
	}
eo to su labeli xD za kucu i biz
RESPECT FOR MILANCE !

probaj ovako
if(strcmp(cmd, "/buyhouse", true) == 0)
	{
            new PropertyString[60];
	    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])
					{
					    Delete3DTextLabel(Text3D:housesale);
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						SafeGivePlayerMoney(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_WHITE, "Cestitamo vam na kupovini nove kuce !");
						SendClientMessage(playerid, COLOR_WHITE, "Kucajte /help da biste dobili pomoc vezanu za kucu !");
						Delete3DTextLabel(Text3D:housesale);
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateCustom(playerid);
                                                format(PropertyString,sizeof(PropertyString),"Vlasnik %s\n Rent: $%d \n Opis: %s \n Za Rent Koristi /rentroom", HouseInfo[h][hOwner], HouseInfo[h][hRent], HouseInfo[h][hDiscription]);
			CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 32, 0, -1, -1, -1, 100.0);
			Create3DTextLabel(PropertyString,0xFF0000FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
			AddStaticPickup(1272, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
			pickups++;
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovoljno novca za kupovinu !");
						return 1;
					}
				}
			}
		}
		return 1;
	}
Poslednja Izmena: Maj 13, 2012, 10:08:02 PRE PODNE od [BM]Don Conellâ„¢