Random Colors
#1

Hello,
I've made a random carcolor function for all my cars, but the colorschedule really sucks. I have only the basic carcolors in my schedule (White, black, red, yellow, etc). Who has a nice colorschedule for me? Without the weird colors such as orange and purple in it?

Greetz,
Danny
Reply
#2

You want a so called "color schedule" with only the primary colors + black and white? ...
Reply
#3

Here Is Some Colors..

Код:
#define GREEN 					0x008000FF
#define BLUE					0x8080FFFF
#define GREEN                                     0x0FBF15FF
#define LIGHTGREEN                             0x24FF0AB9
#define ORANGE					0xFF8000FF
#define PINK					0xFF80C0FF
#define LIGHTBLUE				0x0080C0FF
#define DARKRED                                 0x660000AA
#define GREY                                       0xAFAFAFAA
#define PURPLE                                    0x9E18E7FF
Reply
#4

pawn Код:
#define LIGHTGREEN      0x38FF06FF
#define LIGHTBLUE2   0xF6BB0AA
#define LIGHTBLUE    0x0BBF6AA
#define COLOR_GREEN  0x33AA33AA
#define COLOR_PINK   0xFF66FFAA
#define COLOR_BLUE      0x0000BBAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_BLACK  0x000000AA
#define COLOR_WHITE  0xFFFFFFAA
#define COLOR_GREEN1 0x33AA33AA
#define COLOR_BROWN     0xA52A2AAA
#define blue          0x375FFFFF
#define BlueMsg      0x0BBF6AA
#define white        0xFFFFFFAA
#define red          0xFF0000AA
#define lightred     0xFB0000AA
#define green          0x33FF33AA
#define yellow          0xFFFF00AA
#define grey          0xC0C0C0AA
#define Green1          0x129E12FF
#define Green2           0x53D212FF
#define blue1          0x2641FEAA
#define orange          0xFF9900AA
#define black          0x2C2727AA
not much but k.. got it from luxadmin btw..

If you want more, go search thru admin systems and gamemodes. They got plenty of colors defined..
Reply
#5

No, i mean a carcolor shedule, so something like this, but with more colors in it:

Код:
new colors[10] = { 0, 1, 3, 7, 9, 16, 25, 43, 236, 55 };
Reply
#6

I've got this list generator tool and i did 0 - 126 since those are all colors :P
Код:
new colors[127] = { 0, 01, 02, 03, 04, 05, 06, 07, 08, 09, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045, 046, 047, 048, 049, 050, 051, 052, 053, 054, 055, 056, 057, 058, 059, 060, 061, 062, 063, 064, 065, 066, 067, 068, 069, 070, 071, 072, 073, 074, 075, 076, 077, 078, 079, 080, 081, 082, 083, 084, 085, 086, 087, 088, 089, 090, 091, 092, 093, 094, 095, 096, 097, 098, 099, 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107, 0108, 0109, 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, 0118, 0119, 0120, 0121, 0122, 0123, 0124, 0125, 0126 };
Reply
#7

pawn Код:
new colors[<how many colors you plan to use plus one>] = { 0, 1, 2, 3 };

ChangeVehicleColor(your car ID, colors[random(sizeof(colors))], colors[random(sizeof(colors))]);
Reply
#8

Use something equal to Mike Peterson's variable, then use random() to pick a random color from it - easy as pie.

Example:
pawn Код:
new
    myColors[ number_of_colors ] =
    {
        here, put, the, colors, in, one, by, one
    };
pawn Код:
new
    iRandom = random( sizeof( myColors ));
ChangeVehicleColor( vehicleid_here, myColors[ iRandom ], myColors[ iRandom ] );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)