selectable textdraws - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: selectable textdraws (
/showthread.php?tid=555713)
selectable textdraws -
CoaPsyFactor - 08.01.2015
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
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);
show
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;
}
callback
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;
}
Re: selectable textdraws -
Schneider - 08.01.2015
It won't work if one of the parameters in the PlayerTextDrawTextSize-function is set at '0'. So make those values a bit higher.
Re: selectable textdraws -
CoaPsyFactor - 08.01.2015
still not working, It doesn't call OnPlayerClickPlayerTextDraw at all, even if ESC pressed.
Re: selectable textdraws -
CoaPsyFactor - 09.01.2015
bump