Jump to content
  • 0

Problema 3dtextlabe


ShowBell

Question

16 answers to this question

Recommended Posts

da stuntman am facut alea doar ca daca dau /buybiz sau /buyhouse nu mi se upgradeaza direct... :|

Foloseste streamer by Incognito pentru 3DTexte ? Daca da foloseste UpdateDynamic3DTextLabelText, daca nu merge nici asta, nici cea normala, da-ne comenzile.
Link to comment
Share on other sites

public OnPropTextdrawUpdate(update, id)
{
	if(update == 1)
	{
		if(HouseInfo[id][hOwned] == 0)
		{
            Delete3DTextLabel(HouseLabel[id]);
            format(PropertyString,sizeof(PropertyString),"For Sale! \n Price: $%d \n House: %s \n Level: %d",HouseInfo[id][hValue],HouseInfo[id][hDiscription], HouseInfo[id][hLevel]);
			HouseLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,HouseInfo[id][hEntrancex], HouseInfo[id][hEntrancey], HouseInfo[id][hEntrancez],20.0, 0, 1);
		}
		else if(HouseInfo[id][hOwned] == 1)
		{
		    Delete3DTextLabel(HouseLabel[id]);
			format(PropertyString,sizeof(PropertyString),"Owner: %s \n Rent Price: $%d \n House: %s \n To Rent Type /rentroom",HouseInfo[id][hOwner],HouseInfo[id][hRent], HouseInfo[id][hDiscription]);
			HouseLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,HouseInfo[id][hEntrancex], HouseInfo[id][hEntrancey], HouseInfo[id][hEntrancez],20.0, 0, 1);
		}
	}
	else if(update == 2)
	{
		if(BizzInfo[id][bOwned] == 0)
		{
		    Delete3DTextLabel(BizzLabel[id]);
			format(PropertyString,sizeof(PropertyString),"For Sale! \n Name: %s \n Price: $%d \n Level: %d \n To Buy This, /buybiz",BizzInfo[id][bMessage],BizzInfo[id][bBuyPrice], BizzInfo[id][bLevelNeeded]);
			BizzLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ],20.0, 0, 1);
		}
		else if(BizzInfo[id][bOwned] == 1)
		{
		    Delete3DTextLabel(BizzLabel[id]);
			format(PropertyString,sizeof(PropertyString),"Name: %s \n Owner: %s \n Extortion: %s \n Entering Fee: $%d. \n To enter this, /enter.",BizzInfo[id][bMessage],BizzInfo[id][bOwner],BizzInfo[id][bExtortion], BizzInfo[id][bEntranceCost]);
			BizzLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ],20.0, 0, 1);
		}
	}
	else if(update == 3)
	{
		if(SBizzInfo[id][sbOwned] == 0)
		{
		    Delete3DTextLabel(SBizzLabel[id]);
			format(PropertyString,sizeof(PropertyString),"For Sale! \n Name: %s \n Price: $%d \n Level: %d \n To Buy This, /buysbiz",SBizzInfo[id][sbMessage],SBizzInfo[id][sbBuyPrice], SBizzInfo[id][sbLevelNeeded]);
			SBizzLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,SBizzInfo[id][sbEntranceX], SBizzInfo[id][sbEntranceY], SBizzInfo[id][sbEntranceZ],20.0, 0, 1);
		}
		else if(SBizzInfo[id][sbOwned] == 1)
		{
		    Delete3DTextLabel(SBizzLabel[id]);
			format(PropertyString,sizeof(PropertyString),"Name: %s \n Owner: %s \n Extortion: %s \n Entering Fee: $%d. \n To enter this, /enter.",SBizzInfo[id][sbMessage],SBizzInfo[id][sbOwner],SBizzInfo[id][sbExtortion], SBizzInfo[id][sbEntranceCost]);
			SBizzLabel[id] = Create3DTextLabel(PropertyString ,COLOR_GROVE,SBizzInfo[id][sbEntranceX], SBizzInfo[id][sbEntranceY], SBizzInfo[id][sbEntranceZ],20.0, 0, 1);
		}
	}
	return 1;
}

Asta e updateul dar nu stiu sub ce forma sa il pun la /sellhouse,/buyhouse alea alea ... sau unde sa il folosesc...

Link to comment
Share on other sites

  • La /sellhouse, /buyhouse pui

OnPropTextdrawUpdate(1, id_casa);
id_casa - vezi prin comanda, ca arata ce casa a cumparat
  • La /sellbizz, /buybizz pui
OnPropTextdrawUpdate(2, id_bizz);
id_bizz - vezi prin comanda, ca arata ce bizz a cumparat
  • La /sellsbizz, /buysbizz ( sau cum o fi ) pui
OnPropTextdrawUpdate(3, id_sbizz);

id_sbizz - vezi prin comanda, ca arata ce sbizz a cumparat

Link to comment
Share on other sites

G:\Egammer\gamemodes\egamer.pwn(30829) : error 017: undefined symbol "id_casa"

G:\Egammer\gamemodes\egamer.pwn(31328) : error 017: undefined symbol "id_casa"

dc imi da erorile astea?

Uita-te ce am zis sub
ASTA
. Nu era evident ca trebuie si sa le-nlocuiesti ? ID-urile: casei, bizzului, sbizzului sunt cele de gen
PropOwner[ playerid ] = 1;

1 fiind ID-ul, cam asa este in script.

Link to comment
Share on other sites

PropOwner[ playerid ] = 1; nu gasesc asa ceva in script nici macar PropOwner asta nu gasesc ... nu prea inteleg ce vrei sa zici ... sa inlocuiesc cu un id de casa?

Da-mi comanda /buyhouse si /sellhouse ca sa te prinzi odata cum sa faci la celelalte.
Link to comment
Share on other sites

if(strcmp(cmd, "/sellhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			GetPlayerName(playerid, playername, sizeof(playername));
			if(PlayerInfo[playerid][pPhousekey] == 255)
			{
				SendClientMessage(playerid, COLOR_WHITE1, "You don't own a house.");
				return 1;
			}
			if(PlayerInfo[playerid][pMarried] > 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You are Married, can't sell the House !");
		        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], "The State", 0, strlen("The State"), 255);
				//ConsumingMoney[playerid] = 1;
				GivePlayerCash(playerid,HouseInfo[house][hValue]);
				format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", HouseInfo[house][hValue]);
				GameTextForPlayer(playerid, string, 10000, 3);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				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();
				OnPlayerUpdateEx(playerid);
				OnPropTextdrawUpdate(1, id);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_WHITE1, "You don't own a house.");
			}
		}
		return 1;
	}
si
	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), "   You must be Level %d to purchase this !", 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_WHITE1, "   You already own a house, type /sellhouse if you want to buy this one !");
						return 1;
					}
					if(GetPlayerCash(playerid) > HouseInfo[h][hValue])
					{
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						HouseEntered[playerid] = h;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerCash(playerid,-HouseInfo[h][hValue]);
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,HouseInfo[h][hInt]);
						SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
						SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
						GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
						PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
						PlayerInfo[playerid][pLocal] = h;
						SendClientMessage(playerid, COLOR_WHITE1, "Felicitari pentru noua achizitie!");
						SendClientMessage(playerid, COLOR_WHITE1, "Tasteaza /help pentru mai multe informatii!");
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateEx(playerid);
						OnPropTextdrawUpdate(1, id);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE1, "   Nu ai bani destui !");
						return 1;
					}
				}
			}
		}
		return 1;
	}

Link to comment
Share on other sites

La /sellhouse id-ul casei este reprezentat de

new house = PlayerInfo[playerid][pPhousekey];
house, deci trebuie sa pui in loc de OnPropTextdrawUpdate(1, id); asta: OnPropTextdrawUpdate(1, house); Iar la /buyhouse id-ul casei este reprezentat de
for(new h = 0; h < sizeof(HouseInfo); h++)
{
//etc.
}

de h, deci trebuie sa pui in loc de OnPropTextdrawUpdate(1, id); asta: OnPropTextdrawUpdate(1, h);

La restul sper sa te descurci si singur.

Link to comment
Share on other sites

if(strcmp(cmd, "/sellbiz", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

GetPlayerName(playerid, playername, sizeof(playername));

if(PlayerInfo[playerid][pPbiskey] == 255)

{

SendClientMessage(playerid, COLOR_WHITE1, "You don't own a bizz.");

return 1;

}

if(PlayerInfo[playerid][pMarried] > 0)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are Married, can't sell the House !");

        return 1;

    }

if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)

{

new bouse = PlayerInfo[playerid][pPbiskey]-100;

GivePlayerCash(playerid,SBizzInfo[bouse][sbTill]);

SBizzInfo[bouse][sbLocked] = 1;

SBizzInfo[bouse][sbOwned] = 0;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(SBizzInfo[bouse][sbOwner], "The State", 0, strlen("The State"), 255);

strmid(SBizzInfo[bouse][sbExtortion], "No-one", 0, strlen("No-one"), 255);

//ConsumingMoney[playerid] = 1;

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", SBizzInfo[bouse][sbTill]);

GameTextForPlayer(playerid, string, 10000, 3);

SBizzInfo[bouse][sbTill] = 0;

PlayerInfo[playerid][pPbiskey] = 255;

OnPropUpdate();

OnPlayerUpdateEx(playerid);

OnPropTextdrawUpdate(2, bouse);

return 1;

}

if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)

{

new bouse = PlayerInfo[playerid][pPbiskey];

BizzInfo[bouse][bLocked] = 1;

BizzInfo[bouse][bOwned] = 0;

GetPlayerName(playerid, sendername, sizeof(sendername));

strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);

strmid(BizzInfo[bouse][bExtortion], "No-one", 0, strlen("No-one"), 255);

//ConsumingMoney[playerid] = 1;

GivePlayerCash(playerid,BizzInfo[bouse][bTill]);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", BizzInfo[bouse][bTill]);

GameTextForPlayer(playerid, string, 10000, 3);

BizzInfo[bouse][bTill] = 0;

PlayerInfo[playerid][pPbiskey] = 255;

OnPropUpdate();

OnPlayerUpdateEx(playerid);

OnPropTextdrawUpdate(3, bouse);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_WHITE1, "You don't own a business.");

}

}

return 1;

}

Totusi aici am gresit ceva se pare ... uitate cum am pus OnPropTextdrawUpdate

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.