Raised This Month: $ Target: $400
 0% 

Run time error : native error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-06-2010 , 14:01   Run time error : native error
Reply With Quote #1

I am getting all these errors :

PHP Code:
L 10/06/2010 21:47:49Invalid CVAR pointer
L 10
/06/2010 21:47:49: [AMXXDisplaying debug trace (plugin "Newest.amxx")
L 10/06/2010 21:47:49: [AMXXRun time error 10native error (native "get_pcvar_num")
L 10/06/2010 21:47:49: [AMXX]    [0Newest.sma::HumanAndZombieHealth (line 439)
L 10/06/2010 21:47:49: [AMXX]    [1Newest.sma::ChangeClass (line 421)
L 10/06/2010 21:47:49: [AMXX]    [2Newest.sma::client_putinserver (line 
PHP Code:
L 10/06/2010 21:47:49Invalid CVAR pointer
L 10
/06/2010 21:47:49: [AMXXDisplaying debug trace (plugin "Newest.amxx")
L 10/06/2010 21:47:49: [AMXXRun time error 10native error (native "get_pcvar_num")
L 10/06/2010 21:47:49: [AMXX]    [0Newest.sma::HumanAndZombieHealth (line 439)
L 10/06/2010 21:47:49: [AMXX]    [1Newest.sma::ChangeClass (line 421)
L 10/06/2010 21:47:49: [AMXX]    [2Newest.sma::client_putinserver (line 
Attached Files
File Type: sma Get Plugin or Get Source (Newest.sma - 624 views - 15.2 KB)
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-06-2010 , 14:02   Re: Run time error : native error
Reply With Quote #2

More errors , but they all have the same problem , so i can fix the rest my self
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-06-2010 , 21:56   Re: Run time error : native error
Reply With Quote #3

::sigh:: Just use if-statements or a switch dude, this is ridiculous.

PHP Code:
get_pcvar_numArcticHealth ) : ( hClass == Gign ) ? get_pcvar_numGignHealth ) : ( hClass == Gsg9 ) ? get_pcvar_numGsg9Health ) : ( hClass == Guerilla ) ? get_pcvar_numGuerillaHealth ) : ( hClass == Leet ) ? get_pcvar_numLeetHealth ) : ( hClass == Sas ) ? get_pcvar_numSasHealth ) : ( hClass == Terror ) ? get_pcvar_numTerrorHealth ) : ( hClass == Urban ) ? get_pcvar_numUrbanHealth ) : get_pcvar_numVipHealth ) ) 
Would be very nice formatted like this or you could go a step further use an enum\struct for each player with all settings (health,speed, etc).
PHP Code:
new iHealthCVar;

switch( 
hClass )
{
    case 
ArcticiHealthCVar ArcticHealth;
    case 
CigniHealthCVar GignHealth;
    case 
Gsg9iHealthCVar Gsg9Health;
    case 
GuerillaiHealthCVar GuerillaHealth;
    case 
LeetiHealthCVar LeetHealth;
    case 
SasiHealthCVar SasHealth;
    case 
TerroriHealthCVar TerrorHealth;
    case 
UrbaniHealthCVar UrbanHealth;
    default: 
iHealthCVar VipHealth;
}

fm_set_user_healthid get_pcvar_numiHealthCVar ) ); 
Your error may be caused by how you are declaring your cvars (preceded by a space).

PHP Code:
ArcticHealth register_cvar" Arctic_Health""150" )
ArcticSpeed register_cvar" Arcitc_Speed""400" 
__________________

Last edited by Bugsy; 10-06-2010 at 22:34.
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-06-2010 , 23:06   Re: Run time error : native error
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
Your error may be caused by how you are declaring your cvars (preceded by a space).

PHP Code:
ArcticHealth register_cvar" Arctic_Health""150" )
ArcticSpeed register_cvar" Arcitc_Speed""400" 
I was unable to recreate this error with a test plugin. The cvar worked! Granted, you had to use quotes to set it via server console.

EDIT: What is funny however, is that that single space is the only space that will work . A single space elsewhere or more than one will not work.
__________________

Last edited by fysiks; 10-06-2010 at 23:08.
fysiks is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-07-2010 , 04:29   Re: Run time error : native error
Reply With Quote #5

no difference , even when i use :
PHP Code:
new iHealthCVar;

switch( 
hClass )
{
    case 
ArcticiHealthCVar ArcticHealth;
    case 
CigniHealthCVar GignHealth;
    case 
Gsg9iHealthCVar Gsg9Health;
    case 
GuerillaiHealthCVar GuerillaHealth;
    case 
LeetiHealthCVar LeetHealth;
    case 
SasiHealthCVar SasHealth;
    case 
TerroriHealthCVar TerrorHealth;
    case 
UrbaniHealthCVar UrbanHealth;
    default: 
iHealthCVar VipHealth;
}

fm_set_user_healthid get_pcvar_numiHealthCVar ) ); 
it still gives me the same error ...
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-07-2010 , 10:01   Re: Run time error : native error
Reply With Quote #6

Why don't you confirm that all of the cvar pointers are valid. This is how you find the source of errors on your own.
__________________
Bugsy is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-07-2010 , 10:10   Re: Run time error : native error
Reply With Quote #7

and how do i confirm that all my cvar pointers are valid?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-07-2010 , 10:29   Re: Run time error : native error
Reply With Quote #8

Print them to console or chat

I would also confirm all of your code in plugin init is correct. ie, if you register forwards, be sure the forward function matches the function name when registered. I've seen this cause a similar error that turns out to be completely unrelated to the cvars.
__________________

Last edited by Bugsy; 10-07-2010 at 10:32.
Bugsy is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-07-2010 , 10:39   Re: Run time error : native error
Reply With Quote #9

i still dont get it , do you want me to do something like this

Client_print(id, print_chat, "Your HP is %i", ArcticHealth)

is this a way to confirm that it is a valid cvar?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-07-2010 , 10:55   Re: Run time error : native error
Reply With Quote #10

Just do them all in the same print (%d %d %d etc). Also do what I suggested above.
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:24.


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