23.11.2016, 03:32
Good day
Why do not you show the text when the player enters? I have another text but it is global
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; }