i dont know if it work
#10

Quote:
Originally Posted by avivelkayam
Посмотреть сообщение
if i do this its just moves the bit why i need to do this
its dont do random with all colors

i dont understand can you explane me agin?
As said before, pawn is a 32 bit language, also there is by default only sign numbers ( + and - )
That means if the number is greater than ((2 ^ 31) - 1) [constant cellmax / in hex: 0x7FFFFFFF] it goes negative
Also the random function can only take positive values

Than to your problem, you want a random color, the format in pawn is RGBA (Red - Green - Blue - Alpha)
Means that only the first three RGB tell what color comes out, the Alpha only tells how good you can see it
Since there is no transparency in SendClientMessage you can always use 0xFF as alpha

pawn Код:
new color = random(0xFFFFFF) << 8 | 0xFF;
This randomly generates a color, shift it by 8 bits to the left so they are on the correct position and add full opaque
Reply


Messages In This Thread
i dont know if it work - by avivelkayam - 16.08.2012, 21:43
Re: i dont know if it work - by TaLhA XIV - 16.08.2012, 21:46
Re: i dont know if it work - by avivelkayam - 16.08.2012, 21:59
Re: i dont know if it work - by _Vortex - 16.08.2012, 22:24
Re: i dont know if it work - by avivelkayam - 16.08.2012, 22:40
Re: i dont know if it work - by _Vortex - 16.08.2012, 22:50
Re: i dont know if it work - by Vince - 16.08.2012, 23:18
Re: i dont know if it work - by avivelkayam - 17.08.2012, 09:44
Re: i dont know if it work - by avivelkayam - 17.08.2012, 14:11
AW: Re: i dont know if it work - by Nero_3D - 17.08.2012, 14:32

Forum Jump:


Users browsing this thread: 3 Guest(s)