AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] get_pcvar_num native error (https://forums.alliedmods.net/showthread.php?t=224434)

Choose_Your_Destiny 08-24-2013 11:22

[SOLVED] get_pcvar_num native error
 
Hi guys,

i don't know what is the problem :|

but, show this error in console

Code:

L 08/24/2013 - 18:18:38: [AMXX]    [0] xpmod.sma::show_explevel (line 269)
L 08/24/2013 - 18:18:38: Invalid CVAR pointer
L 08/24/2013 - 18:18:38: [AMXX] Displaying debug trace (plugin "xpmod.amxx")
L 08/24/2013 - 18:18:38: [AMXX] Run time error 10: native error (native "get_pcvar_num")

this code:

PHP Code:

public show_explevel(id){
    if(!
is_user_alive(id)){
        return 
PLUGIN_HANDLED;
    }
    
    new 
ly[33],ey[33],as[33],show[33];
    as[
id] = get_pcvar_num(xpm_start) + (seviye[id] * get_pcvar_num(xpm_inc));
    
ly[id] = seviye[id] * 100 get_pcvar_num(xpm_maxlevel) ;
    
ey[id] = exp[id] * 100 / as[id];
    
    
set_hudmessage255000.020.2006.03.00.11.5 );
    
ShowSyncHudMsg(idhud_show,"Exp/Level" );
    
set_hudmessage2552552550.020.2306.03.00.11.5 );
    
ShowSyncHudMsg(idhud_info"Level: [%d/%d] - (%s%i) ^nExp: [%i/%i] - (%s%i)",seviye[id],get_pcvar_num(xpm_maxlevel),is,ly[id],exp[id],g_exp(id),is,ey[id],show);
    return 
PLUGIN_HANDLED;


What is the problem?

thnx in advance.

Black Rose 08-24-2013 13:28

Re: get_pcvar_num native error
 
Show where the variable is initialized and set using register_cvar().

ConnorMcLeod 08-25-2013 04:00

Re: get_pcvar_num native error
 
Is the error spamming logs ?

Choose_Your_Destiny 08-25-2013 05:26

Re: get_pcvar_num native error
 
i don't know.

i know only doesn't work. :(

good compile, but doesn't work that code.

Black Rose 08-25-2013 08:33

Re: get_pcvar_num native error
 
The problem is that commandThunderOn() is never found, so plugin_init() halts after this line "register_clcmd("+simsek", "commandThunderOn");"
If you comment it out it will remove the error and the xp display will work, but I get a lot of other runtime errors instead.

If you're gonna make plugins, learn to debug.

Also, this is not allowed (and probably disabled in the latest update):
Code:

client_cmd(id, "bind v none");
client_cmd(id, "bind v ^"+simsek^"");
client_cmd(id, "messagemode __xpm_maxlevel");
client_cmd(id, "messagemode __xpm_kill");
client_cmd(id, "messagemode __xpm_inc");
client_cmd(id, "messagemode __xpm_headshot");
client_cmd(id, "messagemode __xpm_knife");
client_cmd(id, "messagemode __xpm_damage_up");
client_cmd(id, "messagemode __xpm_heal_up");


Choose_Your_Destiny 08-25-2013 09:44

Re: get_pcvar_num native error
 
Quote:

Originally Posted by Black Rose (Post 2021257)
The problem is that commandThunderOn() is never found, so plugin_init() halts after this line "register_clcmd("+simsek", "commandThunderOn");"
If you comment it out it will remove the error and the xp display will work, but I get a lot of other runtime errors instead.

If you're gonna make plugins, learn to debug.

Also, this is not allowed (and probably disabled in the latest update):
Code:

client_cmd(id, "bind v none");
client_cmd(id, "bind v ^"+simsek^"");
client_cmd(id, "messagemode __xpm_maxlevel");
client_cmd(id, "messagemode __xpm_kill");
client_cmd(id, "messagemode __xpm_inc");
client_cmd(id, "messagemode __xpm_headshot");
client_cmd(id, "messagemode __xpm_knife");
client_cmd(id, "messagemode __xpm_damage_up");
client_cmd(id, "messagemode __xpm_heal_up");



Thnx man :up:


All times are GMT -4. The time now is 19:04.

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