[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.000000, 384.000000, "");
    
TextDrawBackgroundColor(PlayersOn, 255);
    
TextDrawFont(PlayersOn, 2);
    
TextDrawLetterSize(PlayersOn, 0.170000, 1.399999);
    
TextDrawColor(PlayersOn, -1);
    
TextDrawSetOutline(PlayersOn, 1);
    
TextDrawSetProportional(PlayersOn, 1);
    
TextDrawSetSelectable(PlayersOn, 0);
    
SetTimer("Playerson", 1, true ); 
Public OnPlayerConnect
PHP код:

    TextDrawShowForPlayer
(playerid, PlayersOn); 
Final do gamemode

PHP код:
forward ContarJogadores();
public 
ContarJogadores()
{
    new 
Jogadores = 0;
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        if(
IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            
Jogadores++;
        }
    }
    return 
Jogadores;
}
forward Playerson(playerid);
public 
Playerson(playerid)
{
    new 
Joao[200];
    
format(Joao, 200, "~w~~h~%i/%i", ContarJogadores() ,GetMaxPlayers());
    
TextDrawSetString(PlayersOn, Joao);
    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(Joao, 200, "%i/%i", ContarJogadores() ,GetMaxPlayers()); 
coloque
PHP код:
format(Joao, 200, "%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: