[HELP]: Attach the same 3D text label to vehicles
#1

Hello, so I wanted to attach a single 3d text label to some various vehicles,
the array for these vehicles is gVIPVehicles
so how can I attach it to all of the 387 vehicle without repeating the same function again and again?
Reply
#2

You cannot attach 1 label to 387 vehicles. You can attach 387 labels to 387 vehicles though. Is that what you mean?
Reply
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
You cannot attach 1 label to 387 vehicles. You can attach 387 labels to 387 vehicles though. Is that what you mean?
yeh, literally
Reply
#4

Well I haven't seen your code, so I can only assume at this point. You would need something like this once you've spawned all your vehicles:
PHP код:
for(new 0sizeof(gVIPVehicles); i++)
    
Attach3DTextLabelToVehicle(Create3DTextLabel("VIP Vehicle"0xFF0000AA0.00.0, -10.015.000), gVIPVehicles[i], 0.00.00.0); 
Whereby 'gVIPVehicles[i]' would store the vehicle ID of the vehicle you're trying to attach the label to. The parameters given are just examples, the parameters of Create3DTextLabel and Attached3DTextLabelToVehicle can be found on the wiki. You can also add something to delete the labels OnGameModeExit if you really want to, or when/if a vehicle is destroyed.

The code above would attach a red label with the text "VIP Vehicle" to the centre of each vehicle listed in the array 'gVIPVehicles'.
Reply
#5

Tnx +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)