SA-MP Forums Archive
[Ajuda] Plays e Score - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Plays e Score (/showthread.php?tid=515432)



Plays e Score - CrazyHelp - 25.05.2014

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 ?


Re: Plays e Score - JoaoMonteiro - 25.05.2014

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



Re: Plays e Score - SkullFire - 25.05.2014

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 .