selectable textdraws
#1

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;
}
Reply
#2

It won't work if one of the parameters in the PlayerTextDrawTextSize-function is set at '0'. So make those values a bit higher.
Reply
#3

still not working, It doesn't call OnPlayerClickPlayerTextDraw at all, even if ESC pressed.
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)