Titulo = TextDrawCreate(209.000000, 325.000000, "lalalala");
TextDrawBackgroundColor(Titulo, 255);
TextDrawFont(Titulo, 3);
TextDrawLetterSize(Titulo, 0.569998, 1.200000);
TextDrawColor(Titulo, -1);
TextDrawSetOutline(Titulo, 1);
TextDrawSetProportional(Titulo, 1);
OnPlayerSpawn(playerid)
OpA[playerid] = TextDrawCreate(498.000000, 180.000000, "Fuzileiro");
TextDrawBackgroundColor(OpA[playerid], 255);
TextDrawFont(OpA[playerid], 3);
TextDrawLetterSize(OpA[playerid], 0.569999, 1.400000);
TextDrawColor(OpA[playerid], -1);
TextDrawSetOutline(OpA[playerid], 1);
TextDrawSetProportional(OpA[playerid], 1);
OpB[playerid] = TextDrawCreate(498.000000, 215.000000, "Medico");
TextDrawBackgroundColor(OpB[playerid], 255);
TextDrawFont(OpB[playerid], 3);
TextDrawLetterSize(OpB[playerid], 0.569999, 1.400000);
TextDrawColor(OpB[playerid], -1);
TextDrawSetOutline(OpB[playerid], 1);
TextDrawSetProportional(OpB[playerid], 1);
OpC[playerid] = TextDrawCreate(498.000000, 197.000000, "Engenheiro");
TextDrawBackgroundColor(OpC[playerid], 255);
TextDrawFont(OpC[playerid], 3);
TextDrawLetterSize(OpC[playerid], 0.569999, 1.400000);
TextDrawColor(OpC[playerid], -1);
TextDrawSetOutline(OpC[playerid], 1);
TextDrawSetProportional(OpC[playerid], 1);
OpD[playerid] = TextDrawCreate(498.000000, 231.000000, "Sniper");
TextDrawBackgroundColor(OpD[playerid], 255);
TextDrawFont(OpD[playerid], 3);
TextDrawLetterSize(OpD[playerid], 0.569999, 1.400000);
TextDrawColor(OpD[playerid], -1);
TextDrawSetOutline(OpD[playerid], 1);
TextDrawSetProportional(OpD[playerid], 1);
TextDrawShowForPlayer(playerid, OpA[playerid]);
TextDrawShowForPlayer(playerid, OpB[playerid]);
TextDrawShowForPlayer(playerid, OpC[playerid]);
TextDrawShowForPlayer(playerid, OpD[playerid]);
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == PlayerText:OpA[playerid])
{
WF[playerid][pClass] = 1;
Nome_Classe[playerid] = "Fuzileiro";
SpawnPlayer(playerid);
SendClientMessage(playerid, Branco, "Vocк escolheu a classe Fuzileiro e ganhou seus devidos equipamentos");
CancelSelectTextDraw(playerid);
TextDrawHideForPlayer(playerid, OpA[playerid]);
}
if(playertextid == PlayerText:OpB[playerid])
{
WF[playerid][pClass] = 2;
Nome_Classe[playerid] = "Medico";
SpawnPlayer(playerid);
SendClientMessage(playerid, Branco, "Vocк escolheu a classe Medico e ganhou seus devidos equipamentos");
CancelSelectTextDraw(playerid);
TextDrawHideForPlayer(playerid, OpB[playerid]);
}
if(playertextid == PlayerText:OpC[playerid])
{
WF[playerid][pClass] = 3;
Nome_Classe[playerid] = "Engenheiro";
SpawnPlayer(playerid);
SendClientMessage(playerid, Branco, "Vocк escolheu a classe Engenheiro e ganhou seus devidos equipamentos");
CancelSelectTextDraw(playerid);
TextDrawHideForPlayer(playerid, OpC[playerid]);
}
if(playertextid == PlayerText:OpD[playerid])
{
WF[playerid][pClass] = 4;
Nome_Classe[playerid] = "Sniper";
SpawnPlayer(playerid);
SendClientMessage(playerid, Branco, "Vocк escolheu a classe Sniper e ganhou seus devidos equipamentos");
CancelSelectTextDraw(playerid);
TextDrawHideForPlayer(playerid, OpD[playerid]);
}
return 1;
}
TextDrawCreate = OnPlayerClickTextDraw CreatePlayerTextDraw = OnPlayerClickPlayerTextDraw |
Seguinte: Quando vocк cria uma PlayerTextDraw ela й chamada na public OnPlayerClickPlayerTextDraw, quando vocк cria uma TextDraw pura (que nгo й exclusiva do player), ela й chamada na OnPlayerClickTextDraw...
@EDIT: dб uma olhada no link que o UPSamp deixou aн em cima, quando criar uma textdraw tem que definir ela com o TextDrawSetSelectable... Falando em textdraws, acabo de terminar um layout de textdraws clicбveis, o que acha? xD |