Guten Abend..
Ich habe gerade versucht einen anklickbaren Textdraw zu erstellen, jedoch musste ich feststellen, dass es nicht funktioniert.
Kann mir jemand sagen weshalb?:
Unter OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if(first[playerid]==1 && !IsPlayerNPC(playerid))
{
SetPlayerCameraPos(playerid, 1957.4148,1342.9410,15.3746);
SetPlayerCameraLookAt(playerid, 1952.8490,1342.8617,15.3672);
SWATText0 = CreatePlayerTextDraw(playerid, 243.000000, 198.000000, "SWAT");
PlayerTextDrawBackgroundColor(playerid, SWATText0, 255);
PlayerTextDrawFont(playerid, SWATText0, 1);
PlayerTextDrawLetterSize(playerid, SWATText0, 0.500000, 1.000000);
PlayerTextDrawColor(playerid, SWATText0, -1);
PlayerTextDrawSetOutline(playerid, SWATText0, 0);
PlayerTextDrawSetProportional(playerid, SWATText0, 1);
PlayerTextDrawSetShadow(playerid, SWATText0, 1);
SWATText1 = CreatePlayerTextDraw(playerid, 362.000000, 198.000000, "SUSPECT");
PlayerTextDrawBackgroundColor(playerid, SWATText1, 255);
PlayerTextDrawFont(playerid, SWATText1, 1);
PlayerTextDrawLetterSize(playerid, SWATText1, 0.410000, 1.000000);
PlayerTextDrawColor(playerid, SWATText1, -1);
PlayerTextDrawSetOutline(playerid, SWATText1, 0);
PlayerTextDrawSetProportional(playerid, SWATText1, 1);
PlayerTextDrawSetShadow(playerid, SWATText1, 1);
/*TextDraw0 = CreatePlayerTextDraw(playerid, 297.000000, 142.000000, " ");
PlayerTextDrawBackgroundColor(playerid, TextDraw0, 255);
PlayerTextDrawFont(playerid, TextDraw0, 1);
PlayerTextDrawLetterSize(playerid, TextDraw0, 0.500000, 0.599999);
PlayerTextDrawColor(playerid, TextDraw0, -1);
PlayerTextDrawSetOutline(playerid, TextDraw0, 0);
PlayerTextDrawSetProportional(playerid, TextDraw0, 1);
PlayerTextDrawSetShadow(playerid, TextDraw0, 1);
PlayerTextDrawUseBox(playerid, TextDraw0, 1);
PlayerTextDrawBoxColor(playerid, TextDraw0, 65297);
PlayerTextDrawTextSize(playerid, TextDraw0, 230.000000, -72.000000);
TextDraw1 = CreatePlayerTextDraw(playerid, 426.000000, 142.000000, " ");
PlayerTextDrawBackgroundColor(playerid, TextDraw1, 255);
PlayerTextDrawFont(playerid, TextDraw1, 1);
PlayerTextDrawLetterSize(playerid, TextDraw1, 0.500000, 0.599999);
PlayerTextDrawColor(playerid, TextDraw1, -1);
PlayerTextDrawSetOutline(playerid, TextDraw1, 0);
PlayerTextDrawSetProportional(playerid, TextDraw1, 1);
PlayerTextDrawSetShadow(playerid, TextDraw1, 1);
PlayerTextDrawUseBox(playerid, TextDraw1, 1);
PlayerTextDrawBoxColor(playerid, TextDraw1, -13421807);
PlayerTextDrawTextSize(playerid, TextDraw1, 353.000000, -72.000000);*/
//PlayerTextDrawShow(playerid,TextDraw0);
//PlayerTextDrawShow(playerid,TextDraw1);
PlayerTextDrawShow(playerid,SWATText0);
PlayerTextDrawShow(playerid,SWATText1);
PlayerTextDrawSetSelectable(playerid, SWATText0, true);
PlayerTextDrawSetSelectable(playerid, SWATText1, true);
SelectTextDraw(playerid, 0x000000);
first[playerid]=false;
}
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == SWATText0) {
CancelSelectTextDraw(playerid);
SetPlayerSkin(playerid, 285);
return 1;
}
if(playertextid == SWATText1) {
CancelSelectTextDraw(playerid);
SetPlayerSkin(playerid, 121);
return 1;
}
PlayerTextDrawHide(playerid,SWATText0);
PlayerTextDrawHide(playerid,SWATText1);
PlayerTextDrawHide(playerid,TextDraw0);
PlayerTextDrawHide(playerid,TextDraw1);
return 1;
}
Mit freundlichen Grüßen
Key