Label help
#1

PHP код:
new Text3D:olabel[12];
        
format(strsizeof(str), "%s"name);
    
format(ctrsizeof(ctr), "0x%sFF"orgcolor);
    new 
color;
    
sscanf(ctr"x"color);
    
olabel[giveplayerid-1] = Create3DTextLabel(strcolorxyz+117.5, -10); 
it isn't working I cant see the label in game x y z are the player pos can anyone help?
Reply
#2

Your color is string, but argument in function is not. You have to convert it.
Reply
#3

how?
Reply
#4

By sscanf for example.

Код:
new color;
sscanf(ctr, "x", color);
Reply
#5

Colors are numbers not text. They just happen to be presented in hexadecimal (base 16) instead of decimal (base 10) most of the time because that's easier to read; each color component (red, green, blue and alpha) fits in two hexadecimal digits. There just aren't enough digits to go beyond 9 so letters are used instead.

Decimal Hexadecimal
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
In every other regard it works the same way as any decimal number. Once you run out of digits you roll over and you add another digit. So in decimal when you reach 9 you roll over and add another digit so it becomes 10. In hexadecimal when you reach 0xF you roll over and add another digit so it becomes 0x10 (= 16, see below).

For example, in decimal:
Код:
236 
= 6 * 10^0 + 3 * 10^1 + 2 * 10^2 
= 6 * 1 + 3 * 10 + 2 * 100 
= 6 + 30 + 200
= 236
In hexadecimal:
Код:
EC 
= C * 16^0 + E * 16^1 
= C * 1 + E * 16 
= 12 * 1 + 14 * 16 
= 12 + 224 
= 236
Use sscanf with "x" specifier if it's supposed to be a hexadecimal input. There's not enough context here to give a more detailed answer.
Reply
#6

please help new bug the label not showing in game idk why
Reply
#7

nvm fixed remove
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)