[Ajuda] Textdraw
#1

to fazendo um sistema de olhar e to com uma duvida como fasso pra puxa o ping do player pra a textdra

PHP код:
OLHAR[14] = TextDrawCreate(508.750000243.833297"PING:");
TextDrawLetterSize(OLHAR[14], 0.4499991.600000);
TextDrawAlignment(OLHAR[14], 1);
TextDrawColor(OLHAR[14], -1);
TextDrawSetShadow(OLHAR[14], 0);
TextDrawSetOutline(OLHAR[14], 1);
TextDrawBackgroundColor(OLHAR[14], 51);
TextDrawFont(OLHAR[14], 3);
TextDrawSetProportional(OLHAR[14], 1); 
Reply
#2

Usa um format pra concatenar a string "PING:" com o GetPlayerPing
Reply
#3

tipo assim ?

if(playertextid == Player[playerid]OLHAR[14])
{
new ping = GetPlayerPing(id);
format(string, sizeof(string), "Ping: %d", ping);
}
Reply
#4

И sу que vocк pode simplesmente usar assim:

pawn Код:
new string[20];
format(string, sizeof(string), "Ping: %d", GetPlayerPing(id));
Reply
#5

Уtima dъvida, para sana-la devemos usar duas funзхes nativas..

Precisaremos da funзгo format para poder formatar a string e TextDrawSetString para modificar a string do textdraw.

*LEMBRANDO:
Quando for trabalhar com informaзхes do jogador, sempre й bom usar funзхes especнficas... como CreatePlayerTextDraw que irб criar um textdraw para um jogador especнfico, e PlayerTextDrawSetString aonde modifica APENAS o textdraw de determinado jogador. Estou te alertando isso pois notei que seu cуdigo contйm esse pequeno equivoco, em que existe apenas 1 Textdraw para todos os jogadores. Isto significa que cada vez que a string for alterada, serб alterada para todos e nгo individualmente.


Bons estudos!
Reply
#6

como fasso pra puxar ela der quando o comando
Reply
#7

Quote:
Originally Posted by social
Посмотреть сообщение
como fasso pra puxar ela der quando o comando
Um exemplo simples de como usar as funзхes:
https://sampwiki.blast.hk/wiki/TextDrawSetString


https://sampwiki.blast.hk/wiki/OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)