[Add-ON] Simple textdraw en movimiento
#1

Bueno he estado mucho en SA-MP pero nunca habia posteado por que no sabia que :/

ya que me encantan los textdraw se me ocurrio hacer uno en un movimiento...

aca les dejo el code:


Primero los forward
Код:
forward InicioDraw(texto[],playerid);
forward DrawEntrada(playerid);
NEW
Код:
new Text:Texto_Intro[MAX_PLAYERS];
ENUM
Код:
enum pInfo
{
TextDrawEntrada
}
OnGameModeInit
Код:
SetTimer("DrawEntrada",100,1);

for(new i = 0; i < MAX_PLAYERS; i++)
{
  Texto_Intro[i] = TextDrawCreate(225.000000,140.000000,"Inicio");
  TextDrawFont(Texto_Intro[i],0);
  TextDrawColor(Texto_Intro[i],0xAA3333FF);
  TextDrawLetterSize(Texto_Intro[i],1.0,1.8000000);
  TextDrawSetOutline(Texto_Intro[i],1);
  TextDrawSetShadow(Texto_Intro[i],1);
  TextDrawSetProportional(Texto_Intro[i],1);
  TextDrawBackgroundColor(Texto_Intro[i],0x0000AAFF);
}
OnPlayerRequestClass
Код:
PlayerInfo[playerid][TextDrawEntrada] = 0;
DrawEntrada(playerid);
OnPlayerSpawn
Код:
PlayerInfo[playerid][TextDrawEntrada] = 11;
PUBLIC
Код:
public DrawEntrada(playerid)
{
 if(PlayerInfo[playerid][TextDrawEntrada] == 0)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 1;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 1)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw(" ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 2;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 2)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("  ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 3;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 3)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("   ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 4;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 4)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("    ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 5;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 5)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("     ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 6;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 6)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("    ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 7;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 7)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("   ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 8;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 8)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("  ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 9;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 9)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw(" ~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 10;
  return 1;
 }
  if(PlayerInfo[playerid][TextDrawEntrada] == 10)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  InicioDraw("~y~Revo~r~Gamer~w~Z",playerid);
  PlayerInfo[playerid][TextDrawEntrada] = 1;
  return 1;
 }
 if(PlayerInfo[playerid][TextDrawEntrada] == 11)
 {
  TextDrawHideForPlayer(playerid, Texto_Intro[playerid]);
  return 1;
 }
 return 1;
}

public InicioDraw(texto[],playerid)
{
 TextDrawSetString(Texto_Intro[playerid], texto);
	TextDrawShowForPlayer(playerid, Texto_Intro[playerid]);
}
PD: Disculpenme por hacerlo en el mismo foro esque soy nuevo en esto del pastebin y cosas asi
Reply
#2

No esta mal, te recomendaria usar solo 1 textdraw, en el caso de tu text draw "Revo Gamer Z" no seria molesto que todos los players lo tuvieran al mismo tiempo :P.

Buen Addon
Reply
#3

Bueno si te das cuenta ...

OnPlayerRequestClass:

PlayerInfo[playerid][TextDrawEntrada] = 0; // deja la informacion en 0
DrawEntrada(playerid); // inicia el public con el textdrawentrada en 0 para asi ir avanzando
OnGamemodeinit //hace que el public se repita cada 100 milisegundos
Onplayerspawn //elimina el textdraw

en resumen aparece cuando te estas logueando y se elimina cuando spawnmeas

PD: yo lo ocupo en RP

Saludos... Gracias por tu comentario
Reply
#4

RevoGamerZ ^.^ Me da Gusto que les haya Gustado ese Nombre.


En la Seccion FilterScripts, Hay un FS de eso, y mas complejo, con un solo Textdraw.

Si me tiempo lo busco, sino, subo yo mismo el FS
Reply
#5

Quote:
Originally Posted by Jesus^
Посмотреть сообщение
RevoGamerZ ^.^ Me da Gusto que les haya Gustado ese Nombre.


En la Seccion FilterScripts, Hay un FS de eso, y mas complejo, con un solo Textdraw.

Si me tiempo lo busco, sino, subo yo mismo el FS
sierto hecho `por karkanos o infierno no me acuerdo bien xd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)