Raised This Month: $51 Target: $400
 12% 

Run time error 4: index out of bounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 11-14-2022 , 19:49   Run time error 4: index out of bounds
Reply With Quote #1

I get the following error with this plugin that makes you invisible for 20 seconds:

[AMXX] [0] item_invisibilidad.sma::AddToFullPack (line 42)
[AMXX] Displaying debug trace (plugin "item_invisibilidad.amxx", version "1.0")
[AMXX] Run time error 4: index out of bounds

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <jctf>
native Float:halflife_time()
new 
Float:fPtime[MAX_PLAYERS]
new 
bool:buyed[MAX_PLAYERS]
public 
plugin_init() 
{
    
register_plugin("Item Invisibilidad""1.0""Sugisaki")
    
register_forward(FM_AddToFullPack"AddToFullPack"1)
    
register_event_ex("DeathMsg""event_playerKilled"RegisterEvent_Global)
    
shop_add_item("MENU_SPITEMS_OP_1"90"buy_invisibility")
    
    
register_dictionary("jctf.txt")
}
public 
client_disconnected(id)
{
    
buyed[id] = false
}
public 
buy_invisibility(id)
{
    if(
buyed[id])
    {
        
client_print_color(idprint_team_default"^1[^4CTF^1] %L."id"PRINT_ITEM_USE")
        return 
PLUGIN_HANDLED
    
}
    
    
fPtime[id] = halflife_time() + 20.0
    buyed
[id] = true
    client_print_color
(idprint_team_default"^1[^4CTF^1] %L."id"PRINT_ITEM_INVISIBILITY_BUY")
    
    return 
PLUGIN_CONTINUE
}
public 
AddToFullPack(eseenthostflagsplayerset)
{
    if(!
player)
    {
        return
    }
    
    if(
buyed[ent])
    {
        
set_es(esES_EffectsEF_NODRAW)
        
client_print(entprint_center"%L"ent"PRINT_I_ITEM"fPtime[ent] - halflife_time(), (fPtime[ent] - halflife_time() > 1.9 "s" ""))
        if(
halflife_time() >= fPtime[ent] - 0.1)
        {
            
client_print_color(entprint_team_default"^1[^4CTF^1] %L."ent"PRINT_ITEM_INVISIBILITY_END")
            
buyed[ent] = false
        
}
    }
}
public 
event_playerKilled()
{
    new 
read_data(2)
    if(
buyed[v])
    {
        
buyed[v] = false
    
}

Any solutions?
JuanitoAlimana is online now
 



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 16:22.


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