[Ajuda] Textdraw De Level
#8

Se eu te entendi direito, estamos falando de um valor que varia de player para player, entгo de preferкncia vocк nгo deve usar uma textdraw global e sim uma player textdraw que deve ser criada individualmente para cada player (https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw). E ai ela deve ser criada ao player conectar ou spawnar.


-EDITADO-
Ao player conectar:
pawn Код:
new tdmsg[50];
format(tdmsg, sizeof tdmsg, "My score: %i", GetPlayerScore(playerid));

LevelTD[playerid] = PlayerTextDrawCreate(playerid, 498.000000, 136.000000, tdmsg);
PlayerTextDrawBackgroundColor(playerid, LevelTD[playerid], 255);
PlayerTextDrawFont(playerid, LevelTD[playerid], 2);
PlayerTextDrawLetterSize(playerid, LevelTD[playerid], 0.300000, 1.099997);
PlayerTextDrawColor(playerid, LevelTD[playerid], 16711935);
PlayerTextDrawSetOutline(playerid, LevelTD[playerid], 1);
PlayerTextDrawSetProportional(playerid, LevelTD[playerid], 1);
Ao desconectar:
pawn Код:
PlayerTextDrawDestroy(playerid, LevelTD[playerid]);
Para mostrar a textdraw:
pawn Код:
PlayerTextDrawShow(playerid, LevelTD[playerid]);
Para atualizar a textdraw (ao subir de nivel):
pawn Код:
new tdmsg[50];
format(tdmsg, sizeof tdmsg, "My score: %i", GetPlayerScore(playerid));
PlayerTextDrawSetString(playerid, LevelTD[playerid], tdmsg);
OBS: Nгo esquece de definir a text no topo (new PlayerText:LevelTD[MAX_PLAYERS]).
OBS2: Use PlayerTextDraws apenas para valores que variam de player para player (como nesse caso), pois o limite delas й de 256 para cada jogador e por isso nгo se deve usar elas em valores constantes (fixos).
Reply


Messages In This Thread
Textdraw De Level - by Catchorro - 23.11.2013, 18:56
Re: Textdraw De Level - by Coe1 - 23.11.2013, 18:59
Re: Textdraw De Level - by Ph0ton - 23.11.2013, 19:00
Re: Textdraw De Level - by Catchorro - 23.11.2013, 19:05
Re: Textdraw De Level - by Strike_Legends - 23.11.2013, 19:16
Re: Textdraw De Level - by Catchorro - 23.11.2013, 19:22
Re: Textdraw De Level - by Strike_Legends - 23.11.2013, 19:28
Re: Textdraw De Level - by kreison - 23.11.2013, 19:29

Forum Jump:


Users browsing this thread: 1 Guest(s)