[Ajuda] Plays e Score
#1

Galera estou mexendo na minha GM de truck, estou querendo colocar um texto perto do radar mostrando a quantidade de plays e a quantidade de score, alguem poderia me ajudar ?
Reply
#2

Topo do gamemode
PHP код:

new Text:PlayersOn
Public GameModeInit

PHP код:

    PlayersOn 
TextDrawCreate(12.000000384.000000"");
    
TextDrawBackgroundColor(PlayersOn255);
    
TextDrawFont(PlayersOn2);
    
TextDrawLetterSize(PlayersOn0.1700001.399999);
    
TextDrawColor(PlayersOn, -1);
    
TextDrawSetOutline(PlayersOn1);
    
TextDrawSetProportional(PlayersOn1);
    
TextDrawSetSelectable(PlayersOn0);
    
SetTimer("Playerson"1true ); 
Public OnPlayerConnect
PHP код:

    TextDrawShowForPlayer
(playeridPlayersOn); 
Final do gamemode

PHP код:
forward ContarJogadores();
public 
ContarJogadores()
{
    new 
Jogadores 0;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            
Jogadores++;
        }
    }
    return 
Jogadores;
}
forward Playerson(playerid);
public 
Playerson(playerid)
{
    new 
Joao[200];
    
format(Joao200"~w~~h~%i/%i"ContarJogadores() ,GetMaxPlayers());
    
TextDrawSetString(PlayersOnJoao);
    return 
true;

Faзa o mesmo para o score, mas para o score troque o nome do textdraw, e no settimer, em vez de
PHP код:
format(Joao200"%i/%i"ContarJogadores() ,GetMaxPlayers()); 
coloque
PHP код:
format(Joao200"%i"GetPlayerScore()); 




Espero ter ajudado
Reply
#3

Para o score :

https://sampwiki.blast.hk/wiki/PlayerTextDrawSetString
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
https://sampwiki.blast.hk/wiki/Format
https://sampwiki.blast.hk/wiki/GetPlayerScore

Para a quantidade de players, o cara acima jб explicou .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)