how can i do..... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how can i do..... (
/showthread.php?tid=87881)
how can i do..... -
nuriel8833 - 22.07.2009
that every 1 second the vehice will changehis color from a random colors
tanks for helpers
Re: how can i do..... -
James_Alex - 22.07.2009
try this
pawn Код:
// add this in OnGameModeInit
SetTimer("ChaneColor", 1000, true);
forward ChangeColor();
public ChangeColor()
{
new cRandom;
cRandom = random(8);
SetVehicleColor(vehicle id, cRandom);
return 1;
}
and don't forgot to change the vehicle id by the real veh id !!
Re: how can i do..... -
MachineHead - 22.07.2009
pawn Код:
// add this in OnGameModeInit
SetTimer("ChangeColor", 1000, true);
forward ChangeColor();
public ChangeColor()
{
new cRandom;
cRandom = random(8);
SetVehicleColor(vehicle id, cRandom);
return 1;
}
Spelled 'Change' wrong in the timer
Re: how can i do..... -
James_Alex - 22.07.2009
Quote:
Originally Posted by xClumx``
pawn Код:
// add this in OnGameModeInit
SetTimer("ChangeColor", 1000, true);
forward ChangeColor(); public ChangeColor() { new cRandom; cRandom = random(8); SetVehicleColor(vehicle id, cRandom); return 1; }
Spelled 'Change' wrong in the timer 
|
ah ok i missed that
thx
Re: how can i do..... -
nuriel8833 - 23.07.2009
tanks but how can i add random colors and where i shoult put them?
and what is the line to change vehicle color?
Re: how can i do..... -
ғαιιοцт - 23.07.2009
Quote:
Originally Posted by nuriel8833
tanks but how can i add random colors and where i shoult put them?
and what is the line to change vehicle color?
|
SetVehicleColor(vehicle id, cRandom); is that line
and random(

are the random colors
(random interger from 0-7) so the color can be 0, 1, 2, ..., 7.
Re: how can i do..... -
nuriel8833 - 23.07.2009
but what lines should i put in the random to make the colors change
Re: how can i do..... -
ғαιιοцт - 23.07.2009
Quote:
Originally Posted by nuriel8833
but what lines should i put in the random to make the colors change
|
just change random(8) to random(127) or something, to give you more posibilities
Re: how can i do..... -
nuriel8833 - 23.07.2009
give me an example
Re: how can i do..... -
nuriel8833 - 23.07.2009
2nd page please help me