hleV
04-22-2008, 05:09
Let's say I add a cvar:
register_cvar("jm_custom", "sound/misc/file.mp3") // Set the way to the .mp3 file by cvar
And then I want to precache this file.
public plugin_precache()
{
static custom[128]
get_cvar_string("jm_custom", custom, 127)
precache_sound("%s", custom) // Get the cvar's "jm_custom" string and put it into precache_sound
}
But it doesn't work. I can't use this in plugin_precache(). It failes to compile and shows this:
number of arguments does not match destinition
So is it another way to get cvar's string in plugin_precache?
register_cvar("jm_custom", "sound/misc/file.mp3") // Set the way to the .mp3 file by cvar
And then I want to precache this file.
public plugin_precache()
{
static custom[128]
get_cvar_string("jm_custom", custom, 127)
precache_sound("%s", custom) // Get the cvar's "jm_custom" string and put it into precache_sound
}
But it doesn't work. I can't use this in plugin_precache(). It failes to compile and shows this:
number of arguments does not match destinition
So is it another way to get cvar's string in plugin_precache?