Jump to content

Cum sa faci un TextDraw sa arate jucatorii online.


MrBlack

Recommended Posts

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.

players.JPG

Si gata....

Daca aveti anumite nelamuriri postati aici

Sursa: Sa-mp.Com ( tradus de sandu_mihai aka MrBlack)

Link to comment
Share on other sites

Cine ti-a zis tie ca am tradus niste functii? daca nu te uiti peste tutorial mai bine taci .. am tradus textul desteptule ...

Asa ca nu te mai baga aiurea ....

Link to comment
Share on other sites

Poate nai pus stock.

Poftim fara nici o eroare :P

#include <a_samp>
new Text:players;


public OnFilterScriptInit()
{
        // 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);
		}
	}
	return 1;
}

public OnFilterScriptExit()
{
	TextDrawHideForAll(players);
	TextDrawDestroy(players);
	return 1;
}


stock GetOnLinePlayers()
{
	new OnLine;
	for(new i, g = GetMaxPlayers(); i < g; i++)
		if(IsPlayerConnected(i))
			OnLine++;
	return OnLine;
}

public OnPlayerConnect(playerid)
{
    new strings[15];
	format(strings, 15, "%d/50",GetOnLinePlayers());
	TextDrawSetString(players, strings);
	TextDrawShowForPlayer(playerid, players);
	return 1;
}

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

  • 4 months later...

Cpy-Paste Din Blodz de pe sa-mp.com :)))

Ba baiatule nu te mai baga aiurea , nu este nici un Bloodz de pe sa-mp.com , este tutorial si tradus asa ca taci din gura !

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.