24.10.2014, 11:17
(
Последний раз редактировалось Kyance; 24.10.2014 в 14:49.
)
It's my first time I try something with the clickable textdraws, but the "hitbox" seems to be messing up.
Like, the light(bright over hover) isn't working as it should, and it gets super-buggy on the 2nd spawn;
[ame]http://www.youtube.com/watch?v=Fbjh0h36Rh4[/ame]
The code;
Do I have to set special/other coordinates for the 'hitbox'( click zone, call it w.e you want D: )
Like, the light(bright over hover) isn't working as it should, and it gets super-buggy on the 2nd spawn;
[ame]http://www.youtube.com/watch?v=Fbjh0h36Rh4[/ame]
The code;
pawn Код:
//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);