SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 13/07/2020, 09:49 PM   #1
HusteD
Huge Clucker
 
Join Date: Oct 2017
Posts: 204
Reputation: 0
Default Contagem de Players TXD

Olá queria que minha textdraw contasse quantos players online por exemplo 2/100 etc ...

TextDraw:
Code:
	
	playertextdraw_6[playerid] = CreatePlayerTextDraw(playerid, 40.000000, 311.000000, "Players 0/100");
	PlayerTextDrawFont(playerid, playertextdraw_6[playerid], 1);
	PlayerTextDrawLetterSize(playerid, playertextdraw_6[playerid], 0.266665, 1.500000);
	PlayerTextDrawTextSize(playerid, playertextdraw_6[playerid], 400.000000, 17.000000);
	PlayerTextDrawSetOutline(playerid, playertextdraw_6[playerid], 1);
	PlayerTextDrawSetShadow(playerid, playertextdraw_6[playerid], 0);
	PlayerTextDrawAlignment(playerid, playertextdraw_6[playerid], 1);
	PlayerTextDrawColor(playerid, playertextdraw_6[playerid], -1724723969);
	PlayerTextDrawBackgroundColor(playerid, playertextdraw_6[playerid], 255);
	PlayerTextDrawBoxColor(playerid, playertextdraw_6[playerid], 50);
	PlayerTextDrawUseBox(playerid, playertextdraw_6[playerid], 0);
	PlayerTextDrawSetProportional(playerid, playertextdraw_6[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, playertextdraw_6[playerid], 0);
	PlayerTextDrawShow(playerid, playertextdraw_6[playerid]);
HusteD is offline   Reply With Quote
Old 13/07/2020, 10:01 PM   #2
Khivory
Huge Clucker
 
Khivory's Avatar
 
Join Date: Feb 2020
Posts: 366
Reputation: 23
Default Re: Contagem de Players TXD

Você pode utilizar uma textdraw global para isso, já que a informação será a mesma para todo mundo.


PHP Code:
static    JOGADORES_ONLINE;

public 
OnPlayerConnect(playerid) {
    new 
string[10];
    
format(string10"Players %d/100", (JOGADORES_ONLINE++));
    
TextDrawSetString(textdrawstring);
}

public 
OnPlayerDisconnect(playeridreason) {
    new 
string[10];
    
format(string10"Players %d/100", (JOGADORES_ONLINE--));
    
TextDrawSetString(textdrawstring);

Khivory is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Contagem no HostName caiom1999 Português/Portuguese 3 02/06/2014 08:11 PM
[Pedido] Contagem Freak@ Português/Portuguese 9 30/08/2013 08:21 PM
[Pedido] Contagem entre Players TheKoDaK Português/Portuguese 6 17/08/2013 10:13 PM
[Ajuda] Contagem Lessk Português/Portuguese 5 03/07/2013 01:00 AM
[Ajuda] Contagem regressiva Maklister Português/Portuguese 4 09/01/2013 11:25 PM


All times are GMT. The time now is 12:51 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.