[Tutorial] OnPlayerClickTextDraw RC4 0.3e
#1

Creamos el textdraw bien sea con el editor de Zamaroth u otro programa


Definimos el texdraw:
PHP код:
new Text:Tutorial
Bien ahora, creamos nuestro TextDraw...
pawn Код:
Tutorial = TextDrawCreate(X,Y,Z, "Texto");
TextDrawBackgroundColor(Tutorial, 255);
TextDrawFont(Tutorial, 0);
TextDrawLetterSize(Tutorial, 0.500000, 1.000000);
TextDrawColor(Tutorial, 65535);
TextDrawSetOutline(Tutorial, 0);
TextDrawSetProportional(Tutorial, 1);
TextDrawTextSize(Tutorial, 5, 5); // Debemos usar la funciуn TextDrawTextSize para detectar la dimensiones del TD.
TextDrawUseBox(Tutorial, 1);
TextDrawBoxColor(Tutorial, 65535); TextDrawTextSize(Tutorial, 40.000000, 40.000000);
TextDrawSetSelectable(Tutorial, 1); //Sirve para detectar si el textdraw es seleccionable o no, ponemos 1 = Si.
TextDrawShowForPlayerid(playerid,Tutorial);
Ahora un comando que hara que cuando el ratуn/puntero pase por encima del textdraw cambiarб de color. En "OnPlayerCommandText"
pawn Код:
if(strcmp(cmdtext, "/tutorial", true) == 0)
{
SelectTextDraw(playerid, color); // color sirve para que cuando el ratуn/puntero pasa sobre el textdraw el box cambie a ese color. Ej: 0xfff

return 1;
}
Ahora aсadimos el nuevo callback, "OnPlayerClickTextdraw" y agragamos lo siguiente
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Tutorial)
{
SendClientMessage(playerid,-1, "Ha selecionado el textdrar numero 1");
//Funciones
}
return 1;
}
Crйditos: adri1

Saludos espero haberle ayudado
Reply


Messages In This Thread
OnPlayerClickTextDraw RC4 0.3e - by adri1 - 20.03.2012, 20:47
Re: OnPlayerClickTextDraw RC4 0.3e - by LuisGraph - 20.03.2012, 22:04
Respuesta: OnPlayerClickTextDraw RC4 0.3e - by xSeveNx - 21.03.2012, 01:24
Respuesta: OnPlayerClickTextDraw RC4 0.3e - by davidxxx - 21.03.2012, 01:28
Re: OnPlayerClickTextDraw RC4 0.3e - by Sxriter - 21.03.2012, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)