Updating 3DText on CMD
#1

I have a dynamic busines system, but when you do /lockbiz I cannot get it to update the 3DText at there business to show it's closed

CMD:
Код:
CMD:lockbiz(playerid, params[])
{
	if(PlayerInfo[playerid][pPbizkey] != INVALID_BIZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorX], BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorY], BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorX], BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorY], BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorZ]))) {

		new szMessage[30 + MAX_PLAYER_NAME], string[128];
		new b = PlayerInfo[playerid][pPbizkey] || PlayerInfo[playerid][pPbizkey2];

		if(BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] == 1)
		{
		new biztype[20];
		if(BizInfo[b][b247] == 1)
		{ biztype = "24/7 Store"; }
		if(BizInfo[b][bGunshop] == 1)
		{ biztype = "Gun Store"; }
		if(BizInfo[b][bClotheshop] == 1)
		{ biztype = "Clothing Store"; }
		else { biztype = "Open"; }
		BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] = 0;
		format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid));
		ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Open\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner],b);
		UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string);
		}
		else
		{
		new biztype[20];
		if(BizInfo[b][b247] == 1)
		{ biztype = "24/7 Store"; }
		if(BizInfo[b][bGunshop] == 1)
		{ biztype = "Gun Store"; }
		if(BizInfo[b][bClotheshop] == 1)
		{ biztype = "Clothing Store"; }
		else { biztype = "Open"; }
		BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] = 1;
		format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid));
		ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Closed\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner], b);
		UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string);
		}
	}
	else if(PlayerInfo[playerid][pPbizkey2] != INVALID_BIZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorX], BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorY],BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorX], BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorY], BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorZ]))) {

		new szMessage[30 + MAX_PLAYER_NAME], string[128];
		new b = PlayerInfo[playerid][pPbizkey] || PlayerInfo[playerid][pPbizkey2];

		if(BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] == 1)
		{
			new lockedinfo[20];
			if(BizInfo[b][bLock] == 0)
			{ lockedinfo = "Open"; }
			if(BizInfo[b][bLock] == 1)
			{ lockedinfo = "Closed"; }
			else { lockedinfo = "Open"; }
   			new biztype[20];
			if(BizInfo[b][b247] == 1)
			{ biztype = "24/7 Store"; }
			if(BizInfo[b][bGunshop] == 1)
			{ biztype = "Gun Store"; }
			if(BizInfo[b][bClotheshop] == 1)
			{ biztype = "Clothing Store"; }
			else { biztype = "Open"; }
			BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] = 0;
			format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Open\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner],b);
			UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string);
		}
		else
		{
			new lockedinfo[20];
			if(BizInfo[b][bLock] == 0)
			{ lockedinfo = "Open"; }
			if(BizInfo[b][bLock] == 1)
			{ lockedinfo = "Closed"; }
			else { lockedinfo = "Open"; }
   			new biztype[20];
			if(BizInfo[b][b247] == 1)
			{ biztype = "24/7 Store"; }
			if(BizInfo[b][bGunshop] == 1)
			{ biztype = "Gun Store"; }
			if(BizInfo[b][bClotheshop] == 1)
			{ biztype = "Clothing Store"; }
			else { biztype = "Open"; }
			BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] = 1;
			format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Closed\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner], b);
			UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string);
		}
	}
	return 1;
}
The second part is just if you own a second business.

+rep if anyone can fix this or help me at all
Reply
#2

You can try destroying and re-creating the 3DTextLabel, just to see if that works.
Reply
#3

no idea how i'd do that lol
Reply
#4

pawn Код:
Text3D:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
DestroyDynamic3DTextLabel(Text3D:id);
Do you need any further assistance?
Reply
#5

Still didnt work :/
Reply
#6

I think that to do something like this: CreateDynamicObject needs the latest streamer plugin, I am not 100% sure but try
Reply
#7

Use streamer.In that their is a function named Update3dTextLabel.
Reply
#8

I already have that and it wont update
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)