CLEO Help How to find this type of colour?

CLEO related
Status
Not open for further replies.

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
I have a mod made by i don't know who which can change colours from my hud but i don't know how to find the colours, is there any way to find this type of colours?

FOR EXAMPLE:

RED=-16776961
GREEN=-16711936
BLUE=-65536
YELLOW=-16711681

I use a converter of binary to hex but only the red is working, which converter i need use?
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
springfield link said:
Use colors hex and convert them to decimal.
Yes, i tried with that too but look at this: i use THIS page.

HEX COLOR = FF0000 = RED
DECIMAL COLOR = 16711680, nothing like RED=-16776961 as i said in the post.

What am I doing wrong? Or is a converter problem?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
pepeelpubero link said:
Yes, i tried with that too but look at this: i use THIS page.

HEX COLOR = FF0000 = RED
DECIMAL COLOR = 16711680, nothing like RED=-16776961 as i said in the post.

What am I doing wrong? Or is a converter problem?

Then they are ARGB format, when converted to decimal tend to output a value bigger than 2147483647 which is 32bit max value, so sanny outputs an odd number, it's like this

0xFFFF0000 which is RED in ARGB, its decimal form is 4294901760.

(4294901760 - 2147483647) - 2147483647 = -65534

0xFF00FF00 - Green, decimal form is 4278255360

(4278255360 - 2147483647) - 2147483647 = -16711934
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
springfield link said:
Then they are ARGB format, when converted to decimal tend to output a value bigger than 2147483647 which is 32bit max value, so sanny outputs an odd number, it's like this

0xFFFF0000 which is RED in ARGB, its decimal form is 4294901760.

(4294901760 - 2147483647) - 2147483647 = -65534

0xFF00FF00 - Green, decimal form is 4278255360

(4278255360 - 2147483647) - 2147483647 = -16711934

32 bit max value is 4294967295, fck u springfield get yo shit together.  :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you: :fuck_you:

:HATE: :HATE: :HATE: :HATE: :HATE: :HATE:
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
springfield link said:
Then they are ARGB format, when converted to decimal tend to output a value bigger than 2147483647 which is 32bit max value, so sanny outputs an odd number, it's like this

0xFFFF0000 which is RED in ARGB, its decimal form is 4294901760.

(4294901760 - 2147483647) - 2147483647 = -65534

0xFF00FF00 - Green, decimal form is 4278255360

(4278255360 - 2147483647) - 2147483647 = -16711934
Ok, look at this: for example i want this colour "0A9696" which is this:
MdWt4lA.png

and i need to change it to "0xFF0A9696" so its decimal form is: 4278883990.

(4278883990 - 2147483647) - 2147483647 = -16083304

But in-game show this colour:
GUDs7HE.png


What am i doing wrong?
 

PopandaulX

Active member
Joined
Jul 15, 2013
Messages
189
Reaction score
1
pepeelpubero link said:
Ok, look at this: for example i want this colour "0A9696" which is this:
MdWt4lA.png

and i need to change it to "0xFF0A9696" so its decimal form is: 4278883990.

(4278883990 - 2147483647) - 2147483647 = -16083304

But in-game show this colour:
GUDs7HE.png


What am i doing wrong?
It says FF0A9696 there, but use FF96960A
Use http://www.mathsisfun.com/hexadecimal-decimal-colors.html
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You could have save a LOT of time saying you want to edit gta sa hud colors.
First of all they're RGBA and they need to be written in memory backwards.

So for example red, 0xFF0000 needs to be converted to decimal under RGBA backwards hex form, 0xFF0000FF(A B G R).
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
springfield link said:
You could have save a LOT of time saying you want to edit gta sa hud colors.
First of all they're RGBA and they need to be written in memory backwards.

So for example red, 0xFF0000 needs to be converted to decimal under RGBA backwards hex form, 0xFF0000FF(A B G R).

I said that on the post

pepeelpubero link said:
I have a mod made by i don't know who which can change colours from my hud but i don't know how to find the colours, is there any way to find this type of colours?

And thanks that is how to find the colour, you can lock the post if you want.
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
No problem. Wait, don't lock the post i have a question.

Is possible to check if exist a section in a .ini file? For example:

if
not section "pepe" exist on ini file "config.ini"
then
do something
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You can read the whole file and then compare strings.
But if you use sections and keys they can work as conditions also,
if 0AF4: 0@v = read_string_from_ini_file "cleo\config.ini" section "SectionName" key "stringKey"
then ETC ETC
end
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
springfield link said:
You can read the whole file and then compare strings.
But if you use sections and keys they can work as conditions also,
if 0AF4: 0@v = read_string_from_ini_file "cleo\config.ini" section "SectionName" key "stringKey"
then ETC ETC
end

That's the problem i don't know how to do that.

I have this code: if I type /savecps "name" it will save the xyz pos on a ini file called "name" and if I type /loadcps name it will load that pos then create a checkpoint. The problem is when I type /loadcps "example" and if it doesnt exists also sends the message.

Code:
{$CLEO .cs}

thread "PEPEELPUBERO"

if 
0@ = SAMP.Base()
else_jump @PEPE_77 

:PEPE_77
wait 200 
   SAMP.Available
else_jump @PEPE_77  
0B34: samp register_client_command "savecps" to_label @PEPE_22
0B34: samp register_client_command "loadcps" to_label @PEPE_23

:PEPE_222
wait 0 
jump @PEPE_222  

:PEPE_22
wait 0
    SAMP.IsCommandTyped(3@)
if 
0AD4: 29@ = scan_string 3@ format "%s" 3@v  
else_jump @PEPE_599 
Actor.StorePos($PLAYER_ACTOR, 7@, 8@, 9@)
0AF3: write_float 7@ to_ini_file "cleo\checkpoints.ini" section 3@v key "X" 
0AF3: write_float 8@ to_ini_file "cleo\checkpoints.ini" section 3@v key "Y" 
0AF3: write_float 9@ to_ini_file "cleo\checkpoints.ini" section 3@v key "Z"
0AF8: samp add_message_to_chat "CHECKPOINT \"%s\" SAVED!" color 56576 3@v    
jump @PEPE_888 

:PEPE_599
0AF8: samp add_message_to_chat "USE: /savecps [NAME]" color 14483456

:PEPE_888
SAMP.CmdRet

:PEPE_23               
SAMP.IsCommandTyped(3@)
wait 0
if 
0AD4: 29@ = scan_string 3@ format "%s" 3@v  
else_jump @PEPE_277 
0AF2: 7@ = get_float_from_ini_file "cleo\checkpoints.ini" section 3@v key "X" 
0AF2: 8@ = get_float_from_ini_file "cleo\checkpoints.ini" section 3@v key "Y" 
0AF2: 9@ = get_float_from_ini_file "cleo\checkpoints.ini" section 3@v key "Z"
03BC: 10@ = create_sphere_at 7@ 8@ 9@ radius 3.0
0AF8: samp add_message_to_chat "CHECKPOINT \"%s\" LOADED!" color 56576 3@v
SAMP.CmdRet
jump @PEPE_232     

:PEPE_277
0AF8: samp add_message_to_chat "USE: /loadcps [NAME]" color 14483456

:PEPE_232
SAMP.CmdRet
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
springfield link said:
Make a simple check to see if X is not 0.0?

No, a check to see if 3@v (/loadcps "%s" = 3@v ) exist.

For example /savecps pepe so i need to type /loadcps pepe to load it but if I type /loadcps asd123 it also sends the message but it doesn't exists, here we put the check then doesn't sends the message.
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
pepeelpubero link said:
No, a check to see if 3@v (/loadcps "%s" = 3@v ) exist.

For example /savecps pepe so i need to type /loadcps pepe to load it but if I type /loadcps asd123 it also sends the message but it doesn't exists, here we put the check then doesn't sends the message.

Help, is possible to check this or not?
 
Status
Not open for further replies.
Top