Salut!
Astazi va arat cum sa faceti un textdraw cu numaru de playeri online pe server.
Pasul 1.
Pasul 2.
Scrieti ctrl+f si scrieti Public OnGameModeInit si sub el adaugam:
Ca sa vada toata lumea scrie ctrl+f si scrie OnPlayerConnect si adauga urmatorul cod:
Scrie ctrl+f si scrie OnGameModeExit si dedesupt pune urmatorul cod:
Scrie ctrl+f si scrie stock si o sa iti apara ceva de genul stock right(source[], len) deasupra lui pui urmatorul cod:
Asta a fost tot tutorialul , daca aveti probleme sau nelamuriri lasati un reply.
Astazi va arat cum sa faceti un textdraw cu numaru de playeri online pe server.
Pasul 1.
- Cod:
new Text:players;
Pasul 2.
Scrieti ctrl+f si scrieti Public OnGameModeInit si sub el adaugam:
- Cod:
// 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);
}
}
Ca sa vada toata lumea scrie ctrl+f si scrie OnPlayerConnect si adauga urmatorul cod:
- Cod:
new strings[15];
format(strings, 15, "%d/50",GetOnLinePlayers());
TextDrawSetString(players, strings);
TextDrawShowForPlayer(playerid, players);
Scrie ctrl+f si scrie OnGameModeExit si dedesupt pune urmatorul cod:
- Cod:
TextDrawHideForAll(players);
TextDrawDestroy(players);
Scrie ctrl+f si scrie stock si o sa iti apara ceva de genul stock right(source[], len) deasupra lui pui urmatorul cod:
- Cod:
stock GetOnLinePlayers()
{
new OnLine;
for(new i, g = GetMaxPlayers(); i < g; i++)
if(IsPlayerConnected(i))
OnLine++;
return OnLine;
}
Asta a fost tot tutorialul , daca aveti probleme sau nelamuriri lasati un reply.