[Q] Attach Text To Vehicle - 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: [Q] Attach Text To Vehicle (
/showthread.php?tid=541087)
[Q] Attach Text To Vehicle -
ScorpiusMalfoy - 09.10.2014
I got a question, how to Attach text to all vehicle. if there is a new car , then it automatically attach text to vehicle ?
Same this can i do SetVehicleNumberPlate with all vehicle ? I wanted to set numberplate to all vehicle and using this number plate for Attachtexttovehicle. Anyone can help me pls !
with example number plate SF-XXX
Re: [Q] Attach Text To Vehicle -
AdHaM612 - 10.10.2014
You can put it under OnVehicleSpawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
for(new v=0; v<MAX_VEHICLES; v++)
{
Attach3DTextLabelToVehicle(888 , v, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
SetVehicleNumberPlate(v,"SF-XXX");
}
return 1;
}
So, Whenever a vehicle spawn, it will attach a 3D Text Label to it, and it will set its number plate.
Re: [Q] Attach Text To Vehicle -
Vince - 10.10.2014
What the hell is that loop for if you have "vehicleid" variable right there? Also beware of limits. I don't know what the exact behavior is, but I'm pretty sure that labels aren't destroyed when the vehicle is destroyed. Thus if you keep recreating them you will eventually hit the limit.