Salut la toti , azi va voi invata cum sa faceti sa apara deasupra navigatorului cati playeri online aveti .
Sa incepem
Prima data , punem ce avem mai jos in partea de sus al FilterScript/GameMode
new Text:players;
Acum cauta in gm/fs Public OnGameModeInit/OnFilterScriptInit si adauga asta:
// TextDraw for Players Online
players = TextDrawCreate(54.000000, 326.000000, "_");
TextDrawBackgroundColor(players, 255);
TextDrawFont(players, 2);
TextDrawLetterSize(players, 0.500000, 1.000000);
TextDrawColor(players, -65281);
TextDrawSetOutline(players, 1);
TextDrawSetProportional(players, 1);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, players);
}
}
Ok textdrawl este creat , dar acuma trebuie sa facem sa il arate si la playeri , deci pune asta la OnPlayerConnect
new strings[15];
format(strings, 15, "%d/50",GetOnLinePlayers());
TextDrawSetString(players, strings);
TextDrawShowForPlayer(playerid, players);
In public OnGameModeExit/OnFilterScriptExit pune asta:
TextDrawHideForAll(players);
TextDrawDestroy(players);
Pentru a termina GM/FS pune asta:
stock GetOnLinePlayers()
{
new OnLine;
for(new i, g = GetMaxPlayers(); i < g; i++)
if(IsPlayerConnected(i))
OnLine++;
return OnLine;
}
Asa ar trebui sa arate.
Posted Image
Si gata....
Daca aveti anumite nelamuriri postati aici
Sursa: Sa-mp.Com ( tradus de sandu_mihai aka MrBlack)