[FilterScript] pump it up script (CHANGING VEHICULS COLOR ) ==> must see the video to understand
#1

Pump It Up script (don't ask me why i call it like that "i have no idea")




Small and simple script that i've made in few min (cause i saw some one looking for that but i forget where )
this script is good for STUNT server
i'm not gonna explain what this script do but the video do
(video uploading) coming in few mints

[ame]http://www.youtube.com/watch?v=tzjDdoGhOKE[/ame]
code
Код:
#include <a_samp>
forward pumpitup();
public OnFilterScriptInit()
{
	SetTimer("pumpitup", 100, 1);
	return 1;
}
public OnFilterScriptExit()
{
	return 1;
}
public pumpitup()
{
	for(new i = 0; i < MAX_VEHICLES; i++)
	{
		ChangeVehicleColor(i, Random(255), Random(255));
	}
	return 1;
}
stock Random(min, max)
{
    new a = random(max - min) + min;
    return a;
}
Reply
#2

I'm not trying to be very picky with this release but random already starts the interval at 0. So pumpitup can be better with:

pawn Код:
public pumpitup()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        ChangeVehicleColor(i, random(255), random(255));
    }
    return 1;
}
Good work for a beginner.
Reply
#3

Quote:
Originally Posted by Cyanide
Посмотреть сообщение
I'm not trying to be very picky with this release but random already starts the interval at 0. So pumpitup can be better with:

pawn Код:
public pumpitup()
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        ChangeVehicleColor(i, random(255), random(255));
    }
    return 1;
}
Good work for a beginner.
ooo i see you realy thin that if put 0 or not is gonna change something ??
i don't think so !
but for your info IT COUD BE BETER without random just if i had
ChangeVehicleColor(i,-1, -1);
god reaction for a biginner too
Reply
#4

Quote:
Originally Posted by Amine_Mejrhirrou
Посмотреть сообщение
ooo i see you realy thin that if put 0 or not is gonna change something ??
i don't think so !
but for your info IT COUD BE BETER without random just if i had
ChangeVehicleColor(i,-1, -1);
god reaction for a biginner too
No, he's right. random(value) selects a random value between '0' and 'value - 1'. Also, I read somewhere that colour IDs 128 and above might not work perfectly for other people, so I would restrict it to just using the first 128 color IDs
Reply
#5

ok i've fixed it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)