SA-MP Forums Archive
Changing Objects - 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: Changing Objects (/showthread.php?tid=587189)



Changing Objects - Jigsaw123 - 28.08.2015

Hey guys!

I have an object attached to a vehicle:
Код:
    SirenC = CreateObject(19419, 10.0, 10.0, 10.0, 0, 0, 0);
    AttachObjectToVehicle(SirenC, SDVehicle[i], -0.032000, -0.209999, 0.829999, 0.000000, 0.000000, 0.000000);
I want to make it so that when someone presses the button 'H', the object switches from 19419 to 19420.
Is this possible? If so, How can I do it?


Re: Changing Objects - Boot - 28.08.2015

Use the callback OnPlayerKeyStateChange. When you switch between the objects, don't forget to destroy the old object attached on your car BEFORE creating a new one. I think you got what I meant.

Good luck!


Re: Changing Objects - Jigsaw123 - 28.08.2015

Could you help me make that code really quickly? :P


Re: Changing Objects - Boot - 28.08.2015

Quote:
Originally Posted by Jigsaw123
Посмотреть сообщение
Could you help me make that code really quickly? :P
Yes, but you need to wait some hours until I get at my home!