SA-MP Forums Archive
3DText spawns on the wrong 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: 3DText spawns on the wrong vehicle. (/showthread.php?tid=405299)



3DText spawns on the wrong vehicle. - Lynn - 06.01.2013

Alright, so I have a system to place 3DText on the vehicle, with it's price.
However, if VID 3 is forsale, the Text spawns on Vehicle ID 4. And so on.
pawn Код:
if(DynamicVehicles[idx][CarPrice] != 0)
{
    new str[64];
    format(str, sizeof(str), "Price: ${F81414} %d", DynamicVehicles[idx][CarPrice]);
    DynamicVehicles[idx][Price] = Create3DTextLabel(str, C_WHITE, 0.00, 0.00, 0.00, 20.0, 0, 0);
    Attach3DTextLabelToVehicle(DynamicVehicles[idx][Price], idx, 0.00, 0.00, 1.0);
}
It's very annoying, and I've tried multiple things but it didn't work out overall.


Re: 3DText spawns on the wrong vehicle. - ajam123 - 06.01.2013

Comment Deleted


Re: 3DText spawns on the wrong vehicle. - InActtive™ - 06.01.2013

Where you count the amount of dynamic vehicles, did you add +1 to the actual amount?


Re: 3DText spawns on the wrong vehicle. - Lynn - 06.01.2013

No, I did not.


Re: 3DText spawns on the wrong vehicle. - InActtive™ - 06.01.2013

Quote:
Originally Posted by Lynn
Посмотреть сообщение
No, I did not.
Did you start counting from 0 instead of 1 with the IDs?


Re: 3DText spawns on the wrong vehicle. - Lynn - 06.01.2013

FIXED:
Solution - Added +1, at the vehicleid param for attaching the 3D Textlabel.
I feel dumb.


Re: 3DText spawns on the wrong vehicle. - InActtive™ - 06.01.2013

Isn't that what I asked?!?!? Rofl.