08.01.2015, 17:41
hi,
is there any specific way to draw playertextdraw that is click-able. i tried with PlayerTextDrawSetSelectable, but it looks like OnPlayerClickPlayerTextDraw never get called.
All textdraws show correctly but none is click-able
creations
show
callback
is there any specific way to draw playertextdraw that is click-able. i tried with PlayerTextDrawSetSelectable, but it looks like OnPlayerClickPlayerTextDraw never get called.
All textdraws show correctly but none is click-able
creations
pawn Code:
JobVehiclePTD[playerid][1] = CreatePlayerTextDraw(playerid, 299.333221, 208.251815, "START_WORK");
PlayerTextDrawLetterSize(playerid, JobVehiclePTD[playerid][1], 0.387333, 2.338370);
PlayerTextDrawTextSize(playerid, JobVehiclePTD[playerid][1], 0.000000, 94.666671);
JobVehiclePTD[playerid][5] = CreatePlayerTextDraw(playerid, 253.333343, 234.799987, "EXIT_VEHICLE");
PlayerTextDrawLetterSize(playerid, JobVehiclePTD[playerid][5], 0.400000, 1.600000);
PlayerTextDrawTextSize(playerid, JobVehiclePTD[playerid][5], 345.333312, 0.000000);
pawn Code:
CMD:show(playerid, params[]) {
PlayerTextDrawSetSelectable(playerid, JobVehiclePTD[playerid][5], true);
PlayerTextDrawSetSelectable(playerid, JobVehiclePTD[playerid][1], true);
SelectTextDraw(playerid, 0xFF4040AA);
ShowPTDS(playerid);
return true;
}
pawn Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
new vehicleid = GetPlayerVehicleID(playerid), jobid = StaticVehicles[vehicleid][vJob];
HidePlayerJobVehicleStats(playerid);
if (playertextid == JobVehiclePTD[playerid][1] && jobid && jobid != 255) {
StartJob(playerid, jobid, vehicleid);
} else if (playertextid == JobVehiclePTD[playerid][5]) {
RemovePlayerFromVehicle(playerid);
}
return 0;
}