Jump to content

Tutorial TextDraw Nume


OscarJoaca

Recommended Posts

Salut o sa iti fac eu unul:

Sa incepem

cream un textdraw

new Text:NameText[MAX_PLAYERS];

 

Punem la OnGameModeInit Textdrawul pentru fiecare player

	for(new i = 0;i<MAX_PLAYERS;i++)
	{
		NameText[i] = TextDrawCreate(60.000000, 426.000000, " "); // textdraw cu nume sub mapa
		TextDrawBackgroundColor(NameText[i], 255);
		TextDrawFont(NameText[i], 2);
		TextDrawLetterSize(NameText[i], 0.260000, 1.499999);
		TextDrawColor(NameText[i], 629657343);
		TextDrawSetOutline(NameText[i], 1);
		TextDrawSetProportional(NameText[i], 1);
	}

Iar la OnPlayerConnect punem asta:

new namestring[40],numele[40];
GetPlayerName(playerid,numele,sizeof(numele));
format(namestring,sizeof(namestring), "%s",numele);
    TextDrawSetString(NameText[playerid], namestring);
	TextDrawShowForPlayer(playerid, NameText[playerid]);

Si gata. Sper ca ti-a fost de folos.

  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Salut o sa iti fac eu unul:

Sa incepem

cream un textdraw

new Text:NameText[MAX_PLAYERS];

 

Punem la OnGameModeInit Textdrawul pentru fiecare player

	for(new i = 0;i<MAX_PLAYERS;i++)
	{
		NameText[i] = TextDrawCreate(60.000000, 426.000000, " "); // textdraw cu nume sub mapa
		TextDrawBackgroundColor(NameText[i], 255);
		TextDrawFont(NameText[i], 2);
		TextDrawLetterSize(NameText[i], 0.260000, 1.499999);
		TextDrawColor(NameText[i], 629657343);
		TextDrawSetOutline(NameText[i], 1);
		TextDrawSetProportional(NameText[i], 1);
	}

Iar la OnPlayerConnect punem asta:

new namestring[40],numele[40];
GetPlayerName(playerid,numele,sizeof(numele));
format(namestring,sizeof(namestring), "%s",numele);
    TextDrawSetString(NameText[playerid], namestring);
	TextDrawShowForPlayer(playerid, NameText[playerid]);

Si gata. Sper ca ti-a fost de folos.

Multumesc! ;)

EDIT: Am o eroare....

C:\Users\Damian\Desktop\Gamemodes SAMP\AG RPG\gamemodes\gamemode.pwn(26797) : error 010: invalid function or declaration
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Edited by OscarJoaca
Link to comment
Share on other sites

for(new i=0; i<MAX_PLAYERS; i++)

Pai asa ar trebui sa fie nu stiu ce e gresit, poate e ceva deasupra lui.
   
    Esti sigur ca forul meu nu este deja pus intr-un for? adica textdrawul probabil e pus lintr-un for si ai pus for in for? ceva de genu.

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

for(new i=0; i<MAX_PLAYERS; i++)

Pai asa ar trebui sa fie nu stiu ce e gresit, poate e ceva deasupra lui.
   
    Esti sigur ca forul meu nu este deja pus intr-un for? adica textdrawul probabil e pus lintr-un for si ai pus for in for? ceva de genu.

Am rezolvat, multumesc!

Puteti sa inchideti topic-ul...

Link to comment
Share on other sites

  • WopsS locked this topic
Guest
This topic is now closed to further replies.
×
×
  • 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.