Raised This Month: $ Target: $400
 0% 

Getting error in server console


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Effect
Junior Member
Join Date: May 2010
Old 05-29-2010 , 01:53   Getting error in server console
Reply With Quote #1

I get this error in server console:
Quote:
L 05/29/2010 - 08:44:19: [AMXX] [0] hrk_zpmmod.sma::ShowHealth (line 417)
L 05/29/2010 - 08:44:20: [AMXX] Displaying debug trace (plugin "hrk_zpmmod.amxx")
Using this code:
PHP Code:
public ShowHealth(id)
{

    if (
g_zombie[id] && is_user_alive(id))
    {
        new 
Health
        Health 
get_user_health(id)

        
set_hudmessage(255000.020.9700.00.30.00.0)
        
show_hudmessage(id"|Health: %d || Class: %s|"HealthCLASSES[ZombieClass[id]]) //// on this line is error.
    
}

Who can help me ?
Effect is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-29-2010 , 02:02   Re: Getting error in server console
Reply With Quote #2

I think you are missing the first line or two of the error from the log.
__________________
fysiks is offline
Effect
Junior Member
Join Date: May 2010
Old 05-29-2010 , 02:44   Re: Getting error in server console
Reply With Quote #3

Yes you will right.. here:
Quote:
L 05/29/2010 - 08:44:01: Start of error session.
L 05/29/2010 - 08:52:18: Info (map "de_dust") (file "addons/amxmodx/logs/error_20100529.log")
L 05/29/2010 - 08:52:18: [AMXX] Displaying debug trace (plugin "hrk_zpmmod.amxx")
L 05/29/2010 - 08:52:18: [AMXX] Run time error 4: index out of bounds
L 05/29/2010 - 08:52:18: [AMXX] [0] hrk_zpmmod.sma::ShowHealth (line 417)

Last edited by Effect; 05-29-2010 at 05:00.
Effect is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2010 , 09:25   Re: Getting error in server console
Reply With Quote #4

Index out of bounds error on this: CLASSES[ ZombieClass[id] ]

This means either id is larger than ZombieClass upper-bound or ZombieClass[id] is larger than CLASSES upper-bound. I assume the latter.

Show the definition for both arrays and where they are assigned values.
__________________
Bugsy is offline
Effect
Junior Member
Join Date: May 2010
Old 05-29-2010 , 09:58   Re: Getting error in server console
Reply With Quote #5

This ?:
PHP Code:
#define MAXCLASSES 4

new ZombieClass[33]

new const 
CLASSES[MAXCLASSES][] =
{
    
"Classic",
    
"Electric",
    
"Strong",
    
"Mystic"
}
enum
{
    
Classic 0,
    
Electric,
    
Strong,
    
Mystic

Effect is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-29-2010 , 10:14   Re: Getting error in server console
Reply With Quote #6

Quote:
Originally Posted by Effect View Post
This ?:
PHP Code:
#define MAXCLASSES 4

new ZombieClass[33]

new const 
CLASSES[MAXCLASSES][] =
{
    
"Classic",
    
"Electric",
    
"Strong",
    
"Mystic"
}
enum
{
    
Classic 0,
    
Electric,
    
Strong,
    
Mystic

Quote:
Originally Posted by Bugsy View Post
and where they are assigned values.
Seta00 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2010 , 10:04   Re: Getting error in server console
Reply With Quote #7

Show where ZombieClass[ id ] is assigned a value and make sure id is a value (1-32) player id.
__________________
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-31-2010 , 02:16   Re: Getting error in server console
Reply With Quote #8

Show the full code.
The error will be near a line with set_task().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-31-2010 , 08:31   Re: Getting error in server console
Reply With Quote #9

Quote:
Originally Posted by 'Exolent[jNr
The error will be near a line with set_task().
How do you know that when he didn't show a set_task yet? Tell me your secret
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Effect
Junior Member
Join Date: May 2010
Old 05-31-2010 , 12:52   Re: Getting error in server console
Reply With Quote #10

Here set_task:
PHP Code:
set_task(0.5"ShowHealth"id
Effect 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 05:23.


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