Random colors for spawning vehicles - 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: Random colors for spawning vehicles (
/showthread.php?tid=512569)
Random colors for spawning vehicles -
mickos - 11.05.2014
Hello, I have a /turismo command. It spawns a Turismo vehicle if a player do the command. But how can I give the vehicle random colors, when it spawns its always white. But I want it in random colors. How can I do that?
Thanks!
Regards,
mickos
Re: Random colors for spawning vehicles -
Konstantinos - 11.05.2014
You can use
random function for the colours. An example:
pawn Код:
CreateVehicle(modelid, x, y, z, angle, random(255), random(255), 60);
Re: Random colors for spawning vehicles -
Matess - 11.05.2014
Set vehicle colors on -1, -1
Re: Random colors for spawning vehicles -
PrivatioBoni - 11.05.2014
@Konst
Is there any difference between using -1 and what you suggested? I mean this in a genuinely curious way.
Re: Random colors for spawning vehicles -
Beckett - 11.05.2014
Quote:
Originally Posted by PrivatioBoni
@Konst
Is there any difference between using -1 and what you suggested? I mean this in a genuinely curious way.
|
Using -1 will cause to the color to be randomized there's no really difference from randoming it yourself or using -1.
AW: Random colors for spawning vehicles -
Nero_3D - 11.05.2014
Using -1 will cause the vehicles to use the standard colors used in GTA SA, most vehicles will be random but taxi, police, firefighters, ... will only have one set of colors