Need help deleting 3DText
#1

I have created a matrix system for buses, this is what I got:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1000)
    {
        if(response)
        {
            if(listitem == 0)
            {
                new vehicle_id, Text3D:tabloo;
                tabloo = Create3DTextLabel("1 Ida-Ranniku",0x66CC00FF,1141.34, -1389.88, 15.06,30.0,0);
			    //Creating the Vehicle
			    vehicle_id = GetPlayerVehicleID(playerid);
			    //Attaching Text Label To Vehicle
			    Attach3DTextLabelToVehicle( tabloo, vehicle_id, 0.0, 0.0, 2.0);
                SendClientMessage(playerid, 0x66CC00FF, "Tabloo muudetud!" );
            }
            else if(listitem == 1)
            {
                new vehicle_id, Text3D:tabloo;
                tabloo = Create3DTextLabel("1 Ida-Ranniku",0x66CC00FF,1141.34, -1389.88, 15.06,30.0,0);
			    //Creating the Vehicle
			    vehicle_id = GetPlayerVehicleID(playerid);
			    //Attaching Text Label To Vehicle
			    Attach3DTextLabelToVehicle( tabloo, vehicle_id, 0.0, 0.0, 2.0);
                SendClientMessage(playerid, 0x66CC00FF, "Tabloo muudetud!" );
            }
        }
        return 1;
    }
	return 1;
}
This works perfectly, but what I need is that it deletes old 3Dtext if that exists (and deletes it only on that vehicle, which player is in). Could anyone help me?
Reply
#2

There is an easier way of doing what you want - https://sampwiki.blast.hk/wiki/Update3DTextLabelText
Reply
#3

Edit: Too slow.
Reply
#4

The thing is I have several 3DTexts named tabloo on several buses at the same time. How can I make it update them only on 1 bus at the time and if bus doesn't have any, it still would write a new one. I'm noob in scripting, so helping in writing this would really be appreciated.
Reply
#5

Anyone?
Reply
#6

You need to delete it, but you have to reference by the ID returned when you create it from what I can see.

Which means you need to store the return value at a global level and obviously use different/unique variable names for each bus (if you want to control individually), probably an array of numbers.

Delete3DTextLabel(ID);

But as I said you need to store each buses label as individual ID's so that you can remove them the same way without affecting other buses.

Also I have no idea based on the WIKI how Updating it can do anything, you still need the returns reference ID in order to manipulate it and the other params are only colour and text (no real removal or change of placement, what's the point for this scenario?).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)