Textdraw0 = TextDrawCreate(260.000000, 189.000000, "_");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 11.599994);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
TextDrawUseBox(Textdraw0, 1);
TextDrawBoxColor(Textdraw0, 170);
TextDrawTextSize(Textdraw0, 380.000000, 31.000000);
Textdraw1 = TextDrawCreate(283.000000, 182.000000, "Team Selection");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 2);
TextDrawLetterSize(Textdraw1, 0.200000, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2 = TextDrawCreate(262.000000, 207.000000, "_");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.500000, 3.000000);
TextDrawColor(Textdraw2, -1);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
TextDrawUseBox(Textdraw2, 1);
TextDrawBoxColor(Textdraw2, 714);
TextDrawTextSize(Textdraw2, 378.000000, 0.000000);
Textdraw3 = TextDrawCreate(283.000000, 215.000000, "Survivors");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 2);
TextDrawLetterSize(Textdraw3, 0.330000, 1.100000);
TextDrawColor(Textdraw3, -1);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
Textdraw4 = TextDrawCreate(262.000000, 243.000000, "_");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 2.899999);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
TextDrawUseBox(Textdraw4, 1);
TextDrawBoxColor(Textdraw4, 255);
TextDrawTextSize(Textdraw4, 378.000000, 0.000000);
Textdraw5 = TextDrawCreate(289.000000, 250.000000, "Zombies");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 2);
TextDrawLetterSize(Textdraw5, 0.360000, 1.000000);
TextDrawColor(Textdraw5, -267774465);
TextDrawSetOutline(Textdraw5, 0);
TextDrawSetProportional(Textdraw5, 1);
TextDrawSetShadow(Textdraw5, 1);
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw3)
{
SetPlayerTeam(playerid,1);//Survivors
SpawnPlayer(playerid);
CancelSelectTextDraw(playerid);
}
if(clickedid == Textdraw3)
{
SetPlayerTeam(playerid,2);//Zombies
SpawnPlayer(playerid);
CancelSelectTextDraw(playerid);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_FIRE)
{
SelectTextDraw(playerid, 0xA3B4C5FF);
}
return 1;
}
TextDrawSetSelectable(Texdraw3, 1);
Make sure you use TextDrawTextSize properly. If either X or Y in that function is 0 it won't work. Fiddle around with it a little, because I'm not sure what effect it will have on the appearance of the text. Also don't forget to add TextDrawSetSelectable.
|
Like SaYrOn said, you have to set the TextDraws selectable (TextDrawSetSelectable(handle, 1);, also, make sure not to mess too much with the size of you TextDraw (TextSize, LetterSize, BoxSize ...), only apply the changes you really need to achieve the shape you want, sometimes changes are not visible, but do have an impact on where you can click and where you can't.
|
TextDrawSetSelectable(handle, 1);
I did what you guys says to me but nothing still not working Anyone can help me fast?? Need help fast!
|
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if (PRESSED( KEY_FIRE )) {
// Your code
}
Код:
TextDrawSetSelectable(handle, 1); |
Better use this :
pawn Код:
pawn Код:
Does the mouse appear when pressing KEY_FIRE? |
Textdraw3 = TextDrawCreate(283.000000, 215.000000, "Survivors"); TextDrawBackgroundColor(Textdraw3, 255); TextDrawFont(Textdraw3, 2); TextDrawLetterSize(Textdraw3, 0.330000, 1.100000); TextDrawColor(Textdraw3, -1); TextDrawSetOutline(Textdraw3, 0); TextDrawSetProportional(Textdraw3, 1); TextDrawSetShadow(Textdraw3, 1); TextDrawSetSelectable(Textdraw3, 1);
Does your code look like this?
Код:
Textdraw3 = TextDrawCreate(283.000000, 215.000000, "Survivors"); TextDrawBackgroundColor(Textdraw3, 255); TextDrawFont(Textdraw3, 2); TextDrawLetterSize(Textdraw3, 0.330000, 1.100000); TextDrawColor(Textdraw3, -1); TextDrawSetOutline(Textdraw3, 0); TextDrawSetProportional(Textdraw3, 1); TextDrawSetShadow(Textdraw3, 1); TextDrawSetSelectable(Textdraw3, 1); |
Is the mouse appearing when you press KEY_FIRE? If not, try and make a command for the TextDrawSelect, and tell us if the mouse does appear.
|
TextDrawTextSize(playerid,Textdraw15[playerid], x, y);