PlayerTextDrawShow not show
#1

Good day

Why do not you show the text when the player enters? I have another text but it is global



Код:
new PlayerText:Textdraw0[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
public OnPlayerConnect(playerid){
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 501.500000, 2.488790, "FPS 69  Ping 60  PacketLoss 0.0");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.202499, 0.927999);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
return 1;
}
public OnPlayerSpawn(playerid){
PlayerTextDrawShow(playerid, Textdraw0[playerid] );
return 1;
}

public OnPlayerUpdate(playerid){

    new drunk2 = GetPlayerDrunkLevel(playerid);
	if(drunk2 < 100)
	{
		SetPlayerDrunkLevel(playerid,2000);
	} else {
		if(DLlast[playerid] != drunk2)
		{
			new fps = DLlast[playerid] - drunk2;
			if((fps > 0) && (fps < 200))
			FPS2[playerid] = fps;
			DLlast[playerid] = drunk2;
		}
	}
    Show2(playerid);

return 1;
}

forward Show2(playerid);
public Show2(playerid){
  new ping = GetPlayerPing(playerid);
	new string[160];
	format(string,sizeof(string),"~w~FPS ~r~%d  ~w~Ping ~r~%d  ~w~PacketLoss ~r~%.2f ",FPS2[playerid]-1,ping,NetStats_PacketLossPercent(playerid));
	printf("%s",string);
	PlayerTextDrawSetString(playerid, Textdraw0[playerid],string);

return 1;
}
Reply
#2

Can you try on /cmd ?
I mean put PlayerTextDrawShow(playerid, Textdraw0[playerid] ); in some commands
If thats fine just check your onplayerspawn
Reply
#3

You tried to try with TextDrawShowForPlayer?

Код:
TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
Reply
#4

Yes Speedpro, but doesn't work, and I tried the command and it did not work
Reply
#5

try with this

PHP код:
new PlayerText:Textdraw0[MAX_PLAYERS] = {PlayerText:-1, ...};
public 
OnPlayerConnect(playerid)
{
Textdraw0[playerid] = CreatePlayerTextDraw(playerid501.5000002.488790"FPS 69  Ping 60  PacketLoss 0.0");
PlayerTextDrawLetterSize(playeridTextdraw0[playerid], 0.2024990.927999);
PlayerTextDrawAlignment(playeridTextdraw0[playerid], 1);
PlayerTextDrawColor(playeridTextdraw0[playerid], -1);
PlayerTextDrawSetShadow(playeridTextdraw0[playerid], 0);
PlayerTextDrawSetOutline(playeridTextdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playeridTextdraw0[playerid], 51);
PlayerTextDrawFont(playeridTextdraw0[playerid], 1);
PlayerTextDrawSetProportional(playeridTextdraw0[playerid], 1);
return 
1;

Reply
#6

Now what I do not understand, why did you do it in playertextdraw? If anyway walks, and is better the other way, the normal textdraw. But just in case, try this.

Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
	Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 501.500000, 2.488790, "FPS 69  Ping 60  PacketLoss 0.0");
	PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.202499, 0.927999);
	PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
	PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
	PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 51);
	PlayerTextDrawFont(playerid, Textdraw0[playerid], 1);
	PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
	return 1;
}
public OnPlayerSpawn(playerid)
{
	PlayerTextDrawShow(playerid, Textdraw0[playerid]);
	return 1;
}

public OnPlayerUpdate(playerid){

    new drunk2 = GetPlayerDrunkLevel(playerid);
	if(drunk2 < 100)
	{
		SetPlayerDrunkLevel(playerid,2000);
	} else {
		if(DLlast[playerid] != drunk2)
		{
			new fps = DLlast[playerid] - drunk2;
			if((fps > 0) && (fps < 200))
			FPS2[playerid] = fps;
			DLlast[playerid] = drunk2;
		}
	}
    Show2(playerid);
	return 1;
}

forward Show2(playerid);public Show2(playerid)
{
	new ping = GetPlayerPing(playerid);
	new string[160];
	format(string,sizeof(string),"~w~FPS ~r~%d  ~w~Ping ~r~%d  ~w~PacketLoss ~r~%.2f ",FPS2[playerid]-1,ping,NetStats_PacketLossPercent(playerid));
	printf("%s",string);
	PlayerTextDrawSetString(playerid, Textdraw0[playerid],string);
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)