Raised This Month: $32 Target: $400
 8% 

Solved get_pcvar_float() and ColorChat.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 01-18-2021 , 02:41   get_pcvar_float() and ColorChat.
Reply With Quote #1

hello, i'm trying to display first 2 numbers of a float in chat, but i don t know how, i tried what i found on google but none of the works.

this is my code

PHP Code:

static CamResetTime

CamResetTime 
register_cvar("csgo_camreset""15.0")

CamResetTime 15.0

ColorChat
(idGREEN"%s You can only use^4 Camera View^1 in^4 the first %.2f seconds^1 of every round!"tagget_pcvar_num(CamResetTime)) 
and this is the output

Code:
[JoiNET] You can only use Camera View in the first 0.00 seconds of every round!

Last edited by lexzor; 01-18-2021 at 10:00.
lexzor is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-18-2021 , 02:53   Re: get_pcvar_float() and ColorChat.
Reply With Quote #2

get_pcvar_num



get_pcvar_float


And also remove CamResetTime = 15.0

You must not set a value for CamResetTime since it's a cvar pointer.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-18-2021 at 02:55.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 01-18-2021 , 06:21   Re: get_pcvar_float() and ColorChat.
Reply With Quote #3

ColorChat(index, "your value is %d", floatround(get_pcvar_float(g_iCvarVariable))) ;

floatround(15.0) -> returns 15
floatround(15.5) -> returns 16

Hope i'd helped you!
__________________
LondoN is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 01-18-2021 , 10:00   Re: get_pcvar_float() and ColorChat.
Reply With Quote #4

i used london idea, thanks you all!
lexzor is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode