Quote:
Originally Posted by Bilal Pro
Yes you can, for example
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#define PLUGIN "Example"
#define VERSION "1.0"
#define AUTHOR "Bilal"
new Xp
new Player_XP[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
Xp = register_cvar("test_xp", "1")
register_clcmd("say /test", "CmdGive")
}
public CmdGive(id)
{
if (is_user_connected(id)
{
Player_XP[id] -= get_pcvar_num(Xp)
client_print(id, print_chat, "You have decreased %d xp!", get_pcvar_num(Xp))
}
}
|
That doesn't go with his question at all..
@fysiks: I think he is referring to -1 as the cvar, then getting the cvar and will it still return -1.
So:
Code:
#include <amxmodx>
new pCvar;
public plugin_init() {
pCvar = register_cvar("your_cvar", "-1");
func();
}
public func() {
new iValue;
iValue = get_pcvar_num(pCvar);
client_print(0, print_chat, "Your cvar value is %i", iValue);
}
Although, I'm not sure if it will default it to 0 or not.
__________________