01.12.2014, 15:15
Quote:
Obrigado, a textdraw apareceu, porйm nгo estб trocando a cor, mas sу uma duvida, tem como eu fazer com format ?
tipo assim? pawn Код:
Vi em uma gamemode que baixei a um tempo, achei interessante e procurei o sistema, mas nгo o entendi, muito menos consegui fazer ficar aparecendo! |
PHP код:
forward RandomTD();
new Text:TextDraw;
new Cores[][] = {
"~w~", //Branco
"~b~", //Azul
"~r~", //Vermelho
"~y~", //Amarelo
"~g~" //Verde
};
public OnGameModeInit()
{
TextDraw= TextDrawCreate(7.000000, 427.000000, "textdraw");
TextDrawBackgroundColor(TextDraw, 255);
TextDrawFont(TextDraw, 1);
TextDrawLetterSize(TextDraw, 0.379999, 1.499999);
TextDrawColor(TextDraw, -1);
TextDrawSetOutline(TextDraw, 1);
TextDrawSetProportional(TextDraw, 1);
SetTimer("RandomTD",3000 ,1);
return 1;
}
public RandomTD()
{
new String[150]; //Variavel
/*
No Format, ele pegarб cores aleatуrias
Sintaxe: [Cores[random(Numero_MAXIMO)] ou Cores[random(sizeof(Cores))];
*/
format(String,sizeof(String),"%sIntel%sG%spics%s",Cores[random(4)],Cores[random(4)],Cores[random(4)],Cores[random(4)]);
TextDrawSetString(TextDraw,String); //Seta a String na TextDraw !
return 1;
}
public OnPlayerConnect(playerid) //Chamada quando player connecta
{
TextDrawShowForPlayer(playerid, TextDraw); //Mostra a TextDraw
return 1;
}
public OnPlayerSpawn(playerid) //Chamada quando entra em Spawn
{
TextDrawHideForPlayer(playerid, TextDraw); //Oculta TextDraw
return 1;
}