[AJUDA] Foreach - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Foreach (
/showthread.php?tid=342731)
[AJUDA] Foreach -
.FuneraL. - 14.05.2012
Pessoal , criei uma textdraw aqui usando Foreach , para o contador de FPS, problema й que nгo estou conseguindo mudar a posiзгo dela mesmo mudando as cordenadas , queria saber se isto й possivel de alguma forma.
Re: [AJUDA] Foreach -
CidadeNovaRP - 14.05.2012
Quote:
Originally Posted by .FuneraL.
Pessoal , criei uma textdraw aqui usando Foreach , para o contador de FPS, problema й que nгo estou conseguindo mudar a posiзгo dela mesmo mudando as cordenadas , queria saber se isto й possivel de alguma forma.
|
Verifique tudo que se relaciona com a TextDraw e posta aqui

.
Re: [AJUDA] Foreach -
.FuneraL. - 14.05.2012
pawn Code:
#include <foreach>
foreach(Player, p)
{
FPS[p] = TextDrawCreate(300, 410, "FPS:");
TextDrawBackgroundColor(FPS[p], 255);
TextDrawFont(FPS[p], 1);
TextDrawLetterSize(FPS[p], 0.440000, 1.500000);
TextDrawColor(FPS[p], -1);
TextDrawSetOutline(FPS[p], 0);
TextDrawSetProportional(FPS[p], 1);
TextDrawSetShadow(FPS[p], 1);
}
//OnPlayerConnect
TextDrawShowForPlayer(playerid, FPS[playerid]);
Me corrija se algo estiver errado.
Re: [AJUDA] Foreach -
CidadeNovaRP - 14.05.2012
Quote:
Originally Posted by .FuneraL.
pawn Code:
#include <foreach>
foreach(Player, p) { FPS[p] = TextDrawCreate(300, 410, "FPS:"); TextDrawBackgroundColor(FPS[p], 255); TextDrawFont(FPS[p], 1); TextDrawLetterSize(FPS[p], 0.440000, 1.500000); TextDrawColor(FPS[p], -1); TextDrawSetOutline(FPS[p], 0); TextDrawSetProportional(FPS[p], 1); TextDrawSetShadow(FPS[p], 1); }
//OnPlayerConnect
TextDrawShowForPlayer(playerid, FPS[playerid]);
Me corrija se algo estiver errado.
|
Nгo necessita deste loop '-'
Re: [AJUDA] Foreach -
paulor - 14.05.2012
pawn Code:
//OnPlayerConnect
FPS[playerid] = TextDrawCreate(300, 410, "FPS:");
TextDrawBackgroundColor(FPS[playerid], 255);
TextDrawFont(FPS[playerid], 1);
TextDrawLetterSize(FPS[playerid], 0.440000, 1.500000);
TextDrawColor(FPS[playerid], -1);
TextDrawSetOutline(FPS[playerid], 0);
TextDrawSetProportional(FPS[playerid], 1);
TextDrawSetShadow(FPS[playerid], 1);
TextDrawShowForPlayer(playerid, FPS[playerid]);
//OnPlayerDisconnect
TextDrawHideForAll(FPS[playerid]);
TextDrawDestroy(FPS[playerid]);
Re: [AJUDA] Foreach -
.FuneraL. - 14.05.2012
Quote:
Originally Posted by paulor
pawn Code:
//OnPlayerConnect
FPS[playerid] = TextDrawCreate(300, 410, "FPS:"); TextDrawBackgroundColor(FPS[playerid], 255); TextDrawFont(FPS[playerid], 1); TextDrawLetterSize(FPS[playerid], 0.440000, 1.500000); TextDrawColor(FPS[playerid], -1); TextDrawSetOutline(FPS[playerid], 0); TextDrawSetProportional(FPS[playerid], 1); TextDrawSetShadow(FPS[playerid], 1); TextDrawShowForPlayer(playerid, FPS[playerid]);
//OnPlayerDisconnect
TextDrawHideForAll(FPS[playerid]); TextDrawDestroy(FPS[playerid]);
|
Funcionou Certinho , Vlw Paulo , +Rep.
Re: [AJUDA] Foreach -
Lуs - 14.05.2012
Nгo seria mais fбcil utilizar as novas funзхes do 0.3e para essas
textdraws individuais?
Re: [AJUDA] Foreach -
paulor - 14.05.2012
Quote:
Originally Posted by Los
Nгo seria mais fбcil utilizar as novas funзхes do 0.3e para essas textdraws individuais?
|
Tanto faz!
@Topic
Nds...
Re: [AJUDA] Foreach -
Lуs - 14.05.2012
pawn Code:
new PlayerText:T_FPS[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
T_FPS[playerid] = CreatePlayerTextDraw(playerid, 300, 410, "FPS:");
PlayerTextDrawBackgroundColor(playerid, T_FPS[playerid], 255);
PlayerTextDrawFont(playerid, T_FPS[playerid], 1);
PlayerTextDrawLetterSize(playerid, T_FPS[playerid], 0.440000, 1.500000);
PlayerTextDrawColor(playerid, T_FPS[playerid], -1);
PlayerTextDrawSetOutline(playerid, T_FPS[playerid], 0);
PlayerTextDrawSetProportional(playerid, T_FPS[playerid], 1);
PlayerTextDrawSetShadow(playerid, T_FPS[playerid], 1);
PlayerTextDrawShow(playerid, T_FPS[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid)
{
PlayerTextDrawHide(playerid, T_FPS[playerid]);
PlayerTextDrawDestroy(playerid, T_FPS[playerid]);
return 1;
}
Re: [AJUDA] Foreach -
paulor - 14.05.2012
Quote:
Originally Posted by Los
Tanto faz?
pawn Code:
new PlayerText:T_FPS;
public OnPlayerConnect(playerid) { T_FPS = CreatePlayerTextDraw(playerid, 300, 410, "FPS:"); PlayerTextDrawBackgroundColor(playerid, T_FPS, 255); PlayerTextDrawFont(playerid, T_FPS, 1); PlayerTextDrawLetterSize(playerid, T_FPS, 0.440000, 1.500000); PlayerTextDrawColor(playerid, T_FPS, -1); PlayerTextDrawSetOutline(playerid, T_FPS, 0); PlayerTextDrawSetProportional(playerid, T_FPS, 1); PlayerTextDrawSetShadow(playerid, T_FPS, 1); PlayerTextDrawShow(playerid, T_FPS); return 1; }
public OnPlayerDisconnect(playerid) { PlayerTextDrawHide(playerid, T_FPS); PlayerTextDrawDestroy(playerid, T_FPS); return 1; }
O seu tambйm vai destruir a textdraw de todos assim que um jogador sair do servidor.
|
O seu soh vai funfar pra um player. e o meu nгo vai esconder o de todos pois criou um textdraw em cada celula!