SA-MP Forums Archive
CreatePlayer3DTextLabel wont work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CreatePlayer3DTextLabel wont work (/showthread.php?tid=355934)



CreatePlayer3DTextLabel wont work - Sean.H - 01.07.2012

Hello, i want to see an "Overlay" over the Head from a Person which have Wanteds. Like: "Name: ... Wanteds: ... Reason: ... " It works fine, only my "Update" funktion won't work and i dont know why. (( Sorry for my bad english. ))

Here my Code:

Код:
ocmd:su(playerid,params[])
{
	if(IsACop(playerid) != 1) return SCM(playerid,COLOR_FADE2,"Du bist nicht befugt, diesen Befehl zu nutzen.");
	new giveplayer,reason[128];
	if(sscanf(params,"us",giveplayer,reason)) return SCM(playerid,COLOR_FADE2,"Benutze: /su [PLAYER] [REASON]");
	setcrime(giveplayer,1,reason,PlayerInfo[playerid][pName]);
	format(LastReason[giveplayer],256,"%s",reason);
	new string[128];
	format(string,sizeof(string),"[ %d ] %s\nWantedLevel: %d\nGrund: %s",giveplayer,PlayerInfo[giveplayer][pName],PlayerInfo[giveplayer][pWanteds],LastReason[giveplayer]);
	if(HaveWantedText[giveplayer] == 0)
	{
		for(new i=0;i<MAX_PLAYERS;i++)
		{
			if(PlayerInfo[i][pFraktion] == 0 || PlayerInfo[i][pFraktion] == 1 || PlayerInfo[i][pFraktion] == 2)
			{
				WantedText[giveplayer] = CreatePlayer3DTextLabel(i,string,0xEE0000FF, 0.0, 0.0, 0.5, 60.0,giveplayer, INVALID_VEHICLE_ID, 0); <====== WORK
				HaveWantedText[giveplayer] = 1;
			}
		}
	}
	if(HaveWantedText[giveplayer] == 1)
	{
		for(new i=0;i<MAX_PLAYERS;i++)
		{
			if(PlayerInfo[i][pFraktion] == 0 || PlayerInfo[i][pFraktion] == 1 || PlayerInfo[i][pFraktion] == 2)
			{
				DeletePlayer3DTextLabel(i,WantedText[giveplayer]); // <========= DONT WORK 
				WantedText[giveplayer] = CreatePlayer3DTextLabel(i,string,0xEE0000FF, 0.0, 0.0, 0.5, 60.0,giveplayer, INVALID_VEHICLE_ID, 0); // <====== WORK
			}
		}
	}
	return 1;
}



AW: CreatePlayer3DTextLabel wont work - LeOsk - 01.07.2012

What exactly happens if you su somebody who already have this 3d-text?
Spreche auch deutsch das englische forum ist aber besser


AW: CreatePlayer3DTextLabel wont work - Sean.H - 01.07.2012

Hey, es ьberlappt sich.

Hey, the new Overlay goes "over" the old one, so the "Victim" have 2 Overlays.


AW: CreatePlayer3DTextLabel wont work - LeOsk - 01.07.2012

hmm ok
what about:
UpdatePlayer3DTextLabelText


AW: CreatePlayer3DTextLabel wont work - Sean.H - 01.07.2012

Dont work also. Ive tried it, but same there. It wont work. So ive tried it with Delete.


AW: CreatePlayer3DTextLabel wont work - LeOsk - 01.07.2012

and if you do it with Create3DTextLabel and then Attach3DTextLabelToPlayer


AW: CreatePlayer3DTextLabel wont work - Sean.H - 01.07.2012

but then, every one can see the overlay. but only cops should see it


AW: CreatePlayer3DTextLabel wont work - LeOsk - 01.07.2012

ah ok
well i will have a look tomorrow so far bye


AW: CreatePlayer3DTextLabel wont work - Sean.H - 02.07.2012

Does someone know how to fix it ?


AW: CreatePlayer3DTextLabel wont work - Sean.H - 02.07.2012

PUSH, does somebody know how it works ?