SA-MP Forums Archive
Label help - 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: Label help (/showthread.php?tid=641247)



Edit: Label not showing help - silverms - 13.09.2017

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?


Re: Label help - raydx - 13.09.2017

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


Re: Label help - silverms - 13.09.2017

how?


Re: Label help - raydx - 13.09.2017

By sscanf for example.

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



Re: Label help - Vince - 13.09.2017

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.


Re: Label help - silverms - 13.09.2017

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


Re: Label help - silverms - 13.09.2017

nvm fixed remove