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.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



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 .