SA-MP Forums Archive
Need help with /color. - 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: Need help with /color. (/showthread.php?tid=497294)



Need help with /color. - SyntaxQ - 26.02.2014

I want to make a /color command which will save the color in R-G-B format, so we can save it and load it on connect messages..

RGB -> HexCodes -> ConnectMessage..

I'm using Y_INI saving system.

Any help would be appreciated!


Re: Need help with /color. - terrow - 26.02.2014

Hmmm, to save the color depends of you because only you knows what's in your script
I hope this will help you!

pawn Код:
#define RGBCOLOR(%1,%2,%3,%4) (((((%1) & 0xff) << 24) | (((%2) & 0xff) << 16) | (((%3) & 0xff) << 8) | ((%4) & 0xff)))

// Example //

SetPlayerColor( playerid, RGBCOLOR( random( 235 ) + 20, random( 235 ) + 20, random( 235 ) + 20, 90 ) );
REGARDS


Re: Need help with /color. - Avi Raj - 26.02.2014

Use this include
https://sampforum.blast.hk/showthread.php?tid=71259

It already have like 100+ colors.
Why you want to save in RGB Format?


Re: Need help with /color. - SyntaxQ - 26.02.2014

I don't any colors for my gamemode. I want to make a command /color <R> <G> <B> so it can save the color, it will be converted into Hex Codes (which the SA-MP system can understand) and then it will be used in connect messages:

<His saved color>%s has joined the server.