new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
public OnPlayerConnect(playerid) //A pesar de que puede estar mal puesto todo, estб bien.
{
Textdraw0 = TextDrawCreate(218.000000, 100.000000, "Texto");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 0);
TextDrawLetterSize(Textdraw0, 0.929998, 3.699997);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(224.000000, 144.000000, "Texto");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw3 = TextDrawCreate(273.000000, 87.000000, "Texto");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.440000, 1.200000);
TextDrawColor(Textdraw3, 65535);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
Textdraw4 = TextDrawCreate(240.000000, 174.000000, "Texto");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.350000, 1.000000);
TextDrawColor(Textdraw4, 65535);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
Textdraw2 = TextDrawCreate(6.000000, 429.000000, "Texto");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.389999, 1.399999);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
return 1;
}
Originally Posted by MrDeath
Los textdraws van en OnGameModeInit (OnFilterScriptInit en caso de un FS), y luego se usa: TextDrawShowForPlayer y TextDrawHideForPlayer, para MOSTRARLOS y OCULTARLOS.
Espero que te sirva, saludos. |
//variables
new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
public OnGameModeInit()
{
Textdraw0 = TextDrawCreate(218.000000, 100.000000, "Texto");//crea el textdraw
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 0);
TextDrawLetterSize(Textdraw0, 0.929998, 3.699997);
TextDrawColor(Textdraw0, -16776961);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(224.000000, 144.000000, "Texto");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2 = TextDrawCreate(6.000000, 429.000000, "Texto");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.389999, 1.399999);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
Textdraw3 = TextDrawCreate(273.000000, 87.000000, "Texto");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.440000, 1.200000);
TextDrawColor(Textdraw3, 65535);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
Textdraw4 = TextDrawCreate(240.000000, 174.000000, "Texto");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.350000, 1.000000);
TextDrawColor(Textdraw4, 65535);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw0);// Muestra el textdraw cuando el jugador hace spawn
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
return 1;
}
public OnGameModeExit()
{
TextDrawDestroy(Textdraw0);//destruye el textdraw cuando el gm es des-cargado
TextDrawDestroy(Textdraw1);
TextDrawDestroy(Textdraw2);
TextDrawDestroy(Textdraw3);
TextDrawDestroy(Textdraw4);
return 1;
}