//OnPlayerConnect
SelectionBox1[ playerid ] = TextDrawCreate(220.000000, 143.000000, "~r~Warfare~n~~n~~n~_");
TextDrawAlignment(SelectionBox1[ playerid ], 2);
TextDrawBackgroundColor(SelectionBox1[ playerid ], 255);
TextDrawFont(SelectionBox1[ playerid ], 2);
TextDrawLetterSize(SelectionBox1[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionBox1[ playerid ], -1);
TextDrawSetOutline(SelectionBox1[ playerid ], 0);
TextDrawSetProportional(SelectionBox1[ playerid ], 1);
TextDrawSetShadow(SelectionBox1[ playerid ], 1);
TextDrawUseBox(SelectionBox1[ playerid ], 1);
TextDrawBoxColor(SelectionBox1[ playerid ], 117);
TextDrawTextSize(SelectionBox1[ playerid ], 153, 220);
SelectionBox2[ playerid ] = TextDrawCreate(420.000000, 143.000000, "~g~Stuntzone~n~~n~~n~_");
TextDrawAlignment(SelectionBox2[ playerid ], 2);
TextDrawBackgroundColor(SelectionBox2[ playerid ], 255);
TextDrawFont(SelectionBox2[ playerid ], 2);
TextDrawLetterSize(SelectionBox2[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionBox2[ playerid ], -1);
TextDrawSetOutline(SelectionBox2[ playerid ], 0);
TextDrawSetProportional(SelectionBox2[ playerid ], 1);
TextDrawSetShadow(SelectionBox2[ playerid ], 1);
TextDrawUseBox(SelectionBox2[ playerid ], 1);
TextDrawBoxColor(SelectionBox2[ playerid ], 117);
TextDrawTextSize(SelectionBox2[ playerid ], 153, 420);
SelectionWar[ playerid ] = TextDrawCreate(220.000000, 143.000000, "~n~~n~Players: 0/150");
TextDrawAlignment(SelectionWar[ playerid ], 2);
TextDrawBackgroundColor(SelectionWar[ playerid ], 255);
TextDrawFont(SelectionWar[ playerid ], 2);
TextDrawLetterSize(SelectionWar[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionWar[ playerid ], -1);
TextDrawSetOutline(SelectionWar[ playerid ], 0);
TextDrawSetProportional(SelectionWar[ playerid ], 1);
TextDrawSetShadow(SelectionWar[ playerid ], 1);
SelectionStunt[ playerid ] = TextDrawCreate(420.000000, 143.000000, "~n~~n~Players: 0/150");
TextDrawAlignment(SelectionStunt[ playerid ], 2);
TextDrawBackgroundColor(SelectionStunt[ playerid ], 255);
TextDrawFont(SelectionStunt[ playerid ], 2);
TextDrawLetterSize(SelectionStunt[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionStunt[ playerid ], -1);
TextDrawSetOutline(SelectionStunt[ playerid ], 0);
TextDrawSetProportional(SelectionStunt[ playerid ], 1);
TextDrawSetShadow(SelectionStunt[ playerid ], 1);
TextDrawSetSelectable(SelectionBox1[ playerid ], false);
TextDrawSetSelectable(SelectionBox2[ playerid ], false);
TextDrawSetSelectable(SelectionWar[ playerid ], true);
TextDrawSetSelectable(SelectionStunt[ playerid ], true);
//OnPlayerRequestSpawn
TextDrawShowForPlayer(playerid, SelectionBox[ playerid ]), TextDrawShowForPlayer(playerid, SelectionWar[ playerid ]), TextDrawShowForPlayer(playerid, SelectionStunt[ playerid ]);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 0;
//OnPlayerClickTextDraw
if(clickedid == SelectionWar[ playerid ])
{
HasChosenSpawn{ playerid } = true, SpawnType[ playerid ] = SPAWNMODE_DEFAULT;
SendClientMessage(playerid, COLOR_RADIO, "* You've chosen the 'warfare'(aka 'default') spawn type - to change it again, press 'F4'.");
}
else if(clickedid == SelectionStunt[ playerid ])
{
HasChosenSpawn{ playerid } = true, SpawnType[ playerid ] = SPAWNMODE_STUNT;
SendClientMessage(playerid, COLOR_RADIO, "* You've chosen the 'stunt' spawn type - to change it again, press 'F4'.");
}
TextDrawHideForPlayer(playerid, SelectionBox[ playerid ]), TextDrawHideForPlayer(playerid, SelectionStunt[ playerid ]), TextDrawHideForPlayer(playerid, SelectionWar[ playerid ]);
CancelSelectTextDraw(playerid);
didn't understand the hitbox part, what's it?
Anyways, if it dosen't hover on the clickable textdraws you have set, Use TextDrawTextSize for them so you can create a hidden "box" which when you hover on it , the text will change it's color (SelectTextDraw color) set a TextDrawTextSize of each one of them as their size |
Actually these two clickable textraws doesn't have TextDrawTextSize as they should.
|
SelectionBox1[ playerid ] = TextDrawCreate(220.000000, 143.000000, "~r~Warfare~n~~n~~n~_");
TextDrawAlignment(SelectionBox1[ playerid ], 2);
TextDrawBackgroundColor(SelectionBox1[ playerid ], 255);
TextDrawFont(SelectionBox1[ playerid ], 2);
TextDrawLetterSize(SelectionBox1[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionBox1[ playerid ], -1);
TextDrawSetOutline(SelectionBox1[ playerid ], 0);
TextDrawSetProportional(SelectionBox1[ playerid ], 1);
TextDrawSetShadow(SelectionBox1[ playerid ], 1);
TextDrawUseBox(SelectionBox1[ playerid ], 1);
TextDrawBoxColor(SelectionBox1[ playerid ], 117);
TextDrawTextSize(SelectionBox1[ playerid ], 153, 220);
SelectionBox2[ playerid ] = TextDrawCreate(420.000000, 143.000000, "~g~Stuntzone~n~~n~~n~_");
TextDrawAlignment(SelectionBox2[ playerid ], 2);
TextDrawBackgroundColor(SelectionBox2[ playerid ], 255);
TextDrawFont(SelectionBox2[ playerid ], 2);
TextDrawLetterSize(SelectionBox2[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionBox2[ playerid ], -1);
TextDrawSetOutline(SelectionBox2[ playerid ], 0);
TextDrawSetProportional(SelectionBox2[ playerid ], 1);
TextDrawSetShadow(SelectionBox2[ playerid ], 1);
TextDrawUseBox(SelectionBox2[ playerid ], 1);
TextDrawBoxColor(SelectionBox2[ playerid ], 117);
TextDrawTextSize(SelectionBox2[ playerid ], 153, 420);
SelectionWar[ playerid ] = TextDrawCreate(220.000000, 143.000000, "~n~~n~Players: 0/150");
TextDrawAlignment(SelectionWar[ playerid ], 2);
TextDrawBackgroundColor(SelectionWar[ playerid ], 255);
TextDrawFont(SelectionWar[ playerid ], 2);
TextDrawLetterSize(SelectionWar[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionWar[ playerid ], -1);
TextDrawSetOutline(SelectionWar[ playerid ], 0);
TextDrawSetProportional(SelectionWar[ playerid ], 1);
TextDrawSetShadow(SelectionWar[ playerid ], 1);
SelectionStunt[ playerid ] = TextDrawCreate(420.000000, 143.000000, "~n~~n~Players: 0/150");
TextDrawAlignment(SelectionStunt[ playerid ], 2);
TextDrawBackgroundColor(SelectionStunt[ playerid ], 255);
TextDrawFont(SelectionStunt[ playerid ], 2);
TextDrawLetterSize(SelectionStunt[ playerid ], 0.199999,1.100000);
TextDrawColor(SelectionStunt[ playerid ], -1);
TextDrawSetOutline(SelectionStunt[ playerid ], 0);
TextDrawSetProportional(SelectionStunt[ playerid ], 1);
TextDrawSetShadow(SelectionStunt[ playerid ], 1);
Your TextDrawTextSize() is incorrect TextDrawTextSize(SelectionBox2[ playerid ], 153, 420); that is a huge clickable area....
Also you really need to use Player textdraws. |