Raised This Month: $32 Target: $400
 8% 

[HL Adrenaline ] Client_Data


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 11-11-2017 , 13:10   [HL Adrenaline ] Client_Data
Reply With Quote #1

Error:
Code:
Run time error 4: index out of bounds 
[0] hl_adrenaline_upd.sma::Client_Touch_Rune_Post (line 393)
Line:
Code:
Client_Data(id, _data_Adrenaline) += Client_Data(owner, _data_Adrenaline_Lost)
The whole function:
Code:
public Client_Touch_Rune_Post(ent, id)
{    
    if(pev_valid(ent))
    {
        if(None < id <= MaxPlayers && bit_alive(id))
        {
            if(++Client_Data(id, _data_Rune_Touched) == 0x2)
            {
                Client_Data(id, _data_Rune_Touched) = None
                
                return
            }
            
            new owner
            
            if((owner = pev(ent, pev_owner)) == id)
            {
                bit_fix_sub(id)
            }
        
            Switch_Status(ent, owner, _Entity_Static_Block, _Entity_Hide)
            Client_Data(id, _data_Adrenaline) += Client_Data(owner, _data_Adrenaline_Lost)
    
            switch(Client_Data(id, _data_Rune))
            {
                case None:
                {
                    Add_Rune(id, (pev(ent, pev_body) - 0x1))
                }
            
                default:
                {
                    if(bit_bot_NOT(id) && Client_Data(owner, _data_Adrenaline_Lost))
                    {
                        client_print(id, print_chat, "^^1Адреналин + ^^1%d % = ^^2%d %", Client_Data(owner, _data_Adrenaline_Lost), Client_Data(id, _data_Adrenaline))    
                    }    
                }
            }
        
            Client_Data(owner, _data_Adrenaline_Lost) = None
        
            emit_sound(id, CHAN_AUTO, sound_PickUp_Emit, VOL_NORM, ATTN_NORM, None, PITCH_NORM)
        }
    
        else if(!id || (id > MaxPlayers && pev_valid(id) && pev(id, pev_solid) & SOLID_BSP))
        {
            set_pev(ent, pev_angles, Float:{0.0, 0.0, 0.0})
        }
    }
}
It is incomprehensible and strange:

Plugin for 4 Runes (Abilities). When raising the rune, only the player's Invisibility is an error. If the Bots pick up, there is no error. What can be
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-11-2017 , 14:13   Re: [HL Adrenaline ] Client_Data
Reply With Quote #2

You should post definitions of Client_Data, all _data_* constants (I guess it's an Enum), and any other symbols Client_Data is referencing.

Last edited by klippy; 11-11-2017 at 14:14.
klippy is offline
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 11-11-2017 , 14:39   Re: [HL Adrenaline ] Client_Data
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
You should post definitions of Client_Data, all _data_* constants (I guess it's an Enum), and any other symbols Client_Data is referencing.

I understand You Ser)))
I'll try to do
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 11-14-2017 , 09:20   Re: [HL Adrenaline ] Client_Data
Reply With Quote #4

Checking for the owner

Replaced this
Code:
Client_Data(id, _data_Adrenaline) += Client_Data(owner, _data_Adrenaline_Lost)
this
Code:
new szClassNameOwner[33];
entity_get_string(owner, EV_SZ_classname, szClassNameOwner, charsmax(szClassNameOwner));
server_print("BUGTEST :: owner = %i", owner);
server_print("BUGTEST :: owner classname = %s", szClassNameOwner);

new szClassNameId[33];
entity_get_string(id, EV_SZ_classname, szClassNameId, charsmax(szClassNameId));
server_print("BUGTEST :: id = %i", id);
server_print("BUGTEST :: id classname = %s", szClassNameId);

Result: (similarity id = 2 owner = 3 / etc to 10 (total 10 players)
Code:
BUGTEST :: owner = 9
BUGTEST :: owner classname = player
BUGTEST :: id = 7
BUGTEST :: id classname = player
BUGTEST :: owner = 9
BUGTEST :: owner classname = player
BUGTEST :: id = 7
BUGTEST :: id classname = player
BUGTEST :: owner = 9
BUGTEST :: owner classname = player
BUGTEST :: id = 7
BUGTEST :: id classname = player
BUGTEST :: owner = 9
BUGTEST :: owner classname = player
BUGTEST :: id = 7
BUGTEST :: id classname = player
BUGTEST :: id classname = player
BUGTEST :: owner = 4
BUGTEST :: owner classname = player
BUGTEST :: id = 9
BUGTEST :: id classname = player
BUGTEST :: owner = 4
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
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 19:48.


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