Jump to content
  • 0

pomoc 3D text nad hlavou (WL)


bboyadams

Dotaz

Zdravím, opět tu jsem s prosbou o pomoc. Chci docílit 3dtextu nad hlavou hráče s WL, pokud má, tak se ukáže, pokud ne, ať tam nic není. Nějak to furt blbne, WL funguje, to se vytvoří, ale když má hráč WL 0 (nemá žádný) tak tam furt zůstane ten WL, který měl než to vynulovalo.

 

 

for(new i=0;i<MAX_PLAYERS_EX;i++)
{
if(GetPlayerWantedLevel(i) > 0)
{
new testik[128];
format(testik, sizeof(testik), "Wanted Level %d", GetPlayerWantedLevel(i));
WL = Create3DTextLabel(testik, 0x7FFFD4FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(WL, i, 0.0, 0.0, 0.7);
}
else
{
Delete3DTextLabel(WL);
}
}
Link to comment
Share on other sites

7 odpovědí na tuto otázku

Recommended Posts

  • 0

Použij CreateDynamic3DTextLabel

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);

globální proměnná Text3D:tWL[MAX_PLAYERS];

 

tWL[playerid] = CreateDynamic3DTextLabel("WantedLevel", -1, 0, 0, 0.25, 15.0, playerid);

 

Pokud bys to chtěl smazat, použiješ DestroyDynamic3DTextLabel(tWL[playerid]);

Link to comment
Share on other sites

  • 0

Predpokladam ze ten kod ktery jsi nam ukazal mas v nejakem timeru. V podstate pokazde kdyz se to vyvola ti to vytvori novej text nad hracem. A ty vlastne mazes jen ten posledni vytvorenej a ty ostatni ti tam zustavaj..

new Text3D:WL[MAX_PLAYERS];

WL[playerid] = Create3DTextLabel(" ",0x7FFFD4FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(WL[playerid],playerid,0.0,0.0,0.7);

for(new i;i<MAX_PLAYERS_EX;i++)
{
	if(IsPlayerConnected(i))
	{
		if(GetPlayerWantedLevel(i) > 0)
		{
			new testik[128];
			format(testik,sizeof(testik),"Wanted Level %d",GetPlayerWantedLevel(i));
			Update3DTextLabelText(WL[i],0x7FFFD4FF,testik);
		}
		else Update3DTextLabelText(WL[i],0x7FFFD4FF," ");
	}
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...