![](images/misc/post_spacer.gif) |
Veteran Member
|
![Old](images/statusicon/post_old.svg)
05-19-2023
, 15:19
Re: print wrong message value
|
#3
|
Quote:
Originally Posted by lexzor
you are creating the "num" variable as a cell then you are formating it with fmt using %.1f. there must be a float value.
also, as a suggestion for your plugin even if it's looking like it's useless:
expecting that you would change the value of a various cvars, some of them can be strings, cell, floats etc, you should do something like this
PHP Code:
enum (+=1) { CMD_VALUE_INT = 0, CMD_VALUE_FLOAT }
enum _:CMD_STRUCT { CMD_NAME [32], CMD_INCHAT [32], CMD_SRV [32], CMD_USAGE [128], CMD_LEVEL, CMD_TYPE };
new const CommandsList[Commands][CMD_STRUCT] = { // !rt - flag o (SuperAdmin) { "RoundTime", "rt", "mp_roundtime", "", ADMIN_LEVEL_C, CMD_VALUE_FLOAT } }
so you can use switch with CMD_TYPE for command to know which one of set_pcvar_float/string/int will be used.
|
i will try
Because this is just an introduction from the code, I have a lot more commands in List
I use param and without
EDIT:
Nothing has changed, still writes to me in chat roundtime 0.00
Last edited by Fuck For Fun; 05-19-2023 at 15:24.
|
|
|
|