Thread: [Ajuda] Adicionar TextDraw
View Single Post
Old 29/05/2020, 10:03 PM   #14
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 196
Reputation: 0
Default Re: Adicionar TextDraw

Quote:
Originally Posted by cicinho View Post
Tenta aí...

PHP Code:

new PlayerText:TextCash[MAX_PLAYERS],
    
Timer[MAX_PLAYERS];

public 
OnPlayerConnect(playerid)
{
    
TextCash[playerid] = CreatePlayerTextDraw(playerid29.000000296.933471"Cash:");
    
PlayerTextDrawLetterSize(playeridTextCash[playerid], 0.4499991.600000);
    
PlayerTextDrawAlignment(playeridTextCash[playerid], 1);
    
PlayerTextDrawColor(playeridTextCash[playerid], -1);
    
PlayerTextDrawSetShadow(playeridTextCash[playerid], 0);
    
PlayerTextDrawSetOutline(playeridTextCash[playerid], 1);
    
PlayerTextDrawBackgroundColor(playeridTextCash[playerid], 51);
    
PlayerTextDrawFont(playeridTextCash[playerid], 1);
    
PlayerTextDrawSetProportional(playeridTextCash[playerid], 1);
    
PlayerTextDrawShow(playeridTextCash[playerid]);

    
Timer[playerid] = SetTimerEx("AtualizarCash"1000true"i"playerid);

    return 
true;
}

forward AtualizarCash(playerid);
public 
AtualizarCash(playerid)
{
    new 
String[36];
    
format(String36"Cash: %d"Cash[playerid]);
    
PlayerTextDrawSetString(playeridTextCash[playerid], String);
    return 
true;
}

public 
OnPlayerDisconnect(playerid)
{
    
KillTimer(Timer[playerid]);
    return 
true;

Funcionou perfeitamente, obrigado!

Last edited by SkolPlay; 29/05/2020 at 10:42 PM.
SkolPlay is offline   Reply With Quote