AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_pcvar_num Returning strange encoded strings (https://forums.alliedmods.net/showthread.php?t=250454)

Cv3 10-25-2014 06:42

get_pcvar_num Returning strange encoded strings
 
Here is the glitching part of the plugin I am editing:

Code:

new _chserv_mapcycle
Code:

_chserv_mapcycle = register_cvar ( "fps_serverdir", "27021" )
Code:

formatex ( filename, sizeof ( filename ) - 1, "%s/maps/%s/mpv/maprefix.ini", g_configsdir, get_pcvar_num(_chserv_mapcycle) )

L 10/25/2014 - 06:39:14: [mapsnew.amxx] File "addons/amxmodx/configs/maps/▒;
L 10/25/2014 - 06:39:14: [mapsnew.amxx] File "addons/amxmodx/configs/maps/▒;

Any ideas why the get_pcvar_num returns the strange encoded string ?

Fixed it: instead of the 2nd %s I used %d

HamletEagle 10-25-2014 07:18

Re: get_pcvar_num Returning strange encoded strings
 
You are returning an integer with get_pcvar_num, but you are using %s. %i is for integers.

Cv3 10-25-2014 11:23

Re: get_pcvar_num Returning strange encoded strings
 
That's because before that it was a string but I decided to make it integer since the other way around it was returning me error. Even tho now it's working fine. Thanks for the feedback tho.

HamletEagle 10-25-2014 11:29

Re: get_pcvar_num Returning strange encoded strings
 
I think get_pcvar_string didn't worked because you didn't used it correctly.

Code:
new szString[ some_size_here ] get_pcvar_string(some_pcvar_here, szString, charsmax(szString))

This is how you use it.


All times are GMT -4. The time now is 17:29.

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