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

Run time error 10


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
giumbalau
Member
Join Date: Jan 2021
Old 03-02-2021 , 12:53   Run time error 10
Reply With Quote #1

Any idea to fix this please ?

PHP Code:
L 03/02/2021 16:38:20Player 3 is not in game.
L 03/02/2021 16:38:20: [AMXXRun time error 10 (plugin "csdm_equip.amxx") (native "menu_display") - debug not enabled!
L 03/02/2021 16:38:20: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quotes).
L 03/02/2021 17:15:32Start of error session.
L 03/02/2021 17:15:32Info (map "fy_snow3x") (file "addons/amxmodx/logs/error_20210302.log")
L 03/02/2021 17:15:32: [CSTRIKENon-player entity 0 out of range
L 03
/02/2021 17:15:32: [AMXXRun time error 10 (plugin "csdm_refill.amxx") (native "cs_set_weapon_ammo") - debug not enabled!
L 03/02/2021 17:15:32: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quotes).
L 03/02/2021 17:16:07: [CSTRIKENon-player entity 0 out of range
L 03
/02/2021 17:16:07: [AMXXRun time error 10 (plugin "csdm_refill.amxx") (native "cs_set_weapon_ammo") - debug not enabled
PHP Code:
/**

 * csdm_equip.sma

 * Allows for Counter-Strike to be played as DeathMatch.

 *

 * CSDM Equipment Menu

 *

 * By Freecode and BAILOPAN

 * (C)2003-2006 David "BAILOPAN" Anderson

 *

 *  Give credit where due.

 *  Share the source - it sets you free

 *  http://www.opensource.org/

 *  http://www.gnu.org/

 */

 

#include <amxmodx>

#include <amxmisc>

#include <cstrike>

#include <csdm>

#include <fakemeta>



//Tampering with the author and name lines can violate the copyright

new PLUGINNAME[] = "CSDM Equip"

new VERSION[] = CSDM_VERSION

new AUTHORS[] = "CSDM Team"



#define    EQUIP_PRI    (1<<0)

#define    EQUIP_SEC    (1<<1)

#define    EQUIP_ARMOR    (1<<2)

#define    EQUIP_GREN    (1<<3)

#define EQUIP_ITEMS    (1<<4)

#define    EQUIP_ALL    (EQUIP_PRI|EQUIP_SEC|EQUIP_ARMOR|EQUIP_GREN|EQUIP_ITEMS)



//Menus

new g_SecMenu[] = "CSDM: Secondary Weapons"        // Menu Name

new g_SecMenuID = -1                            // Menu ID

new g_cSecondary                                // Menu Callback

new bool:g_mSecStatus true                    // Menu Available?



new g_PrimMenu[] = "CSDM: Primary Weapons"

new g_PrimMenuID = -1

new g_cPrimary

new bool:g_mPrimStatus true



new g_ArmorMenu[] = "CSDM: Armor"

new g_ArmorMenuID = -1

new bool:g_mArmorStatus true



new g_NadeMenu[] = "CSDM: Grenades"

new g_NadeMenuID = -1

new bool:g_mNadeStatus true



new g_EquipMenu[] = "CSDM: Equip"

new g_EquipMenuID = -1



new bool:g_mShowuser[33] = true



new bool:g_mAutoNades false

new bool:g_mAutoArmor false



//Weapon Selections

new g_SecWeapons[33][18]

new 
g_PrimWeapons[33][18]

new 
bool:g_mNades[33]

new 
bool:g_mArmor[33]



//Config weapon storage holders

new g_BotPrim[MAX_WEAPONS][18]

new 
g_iNumBotPrim



new g_BotSec[MAX_WEAPONS][18]

new 
g_iNumBotSec



new g_Secondary[MAX_SECONDARY][18]

new 
bool:g_DisabledSec[MAX_WEAPONS]

new 
g_iNumSec



new g_Primary[MAX_PRIMARY][18]

new 
bool:g_DisabledPrim[MAX_WEAPONS]

new 
g_iNumPrim



#define SILENCED_M4A1    0

#define SILENCED_USP        1

new bool:g_Silenced[33][2]



//Misc

new g_Armor 0

new fnadesnum 0

new bool:g_Flash false

new bool:g_Nade false

new bool:g_Smoke false

new bool:g_NightVision false

new bool:g_DefuseKit false



//Quick Fix for menu pages

new g_MenuState[33] = {0}



public 
csdm_Init(const version[])

{

    if (
version[0] == 0)

    {

        
set_fail_state("CSDM failed to load.")

        return

    }

    

    
// Menus and callbacks

    
g_SecMenuID menu_create(g_SecMenu"m_SecHandler"0)

    
g_PrimMenuID menu_create(g_PrimMenu"m_PrimHandler"0)

    
g_ArmorMenuID menu_create(g_ArmorMenu"m_ArmorHandler"0)

    
g_NadeMenuID menu_create(g_NadeMenu"m_NadeHandler"0)

    
g_EquipMenuID menu_create(g_EquipMenu"m_EquipHandler"0)

    

    
menu_setprop(g_PrimMenuIDMPROP_EXITMEXIT_NEVER)

    
menu_setprop(g_SecMenuIDMPROP_EXITMEXIT_NEVER)

    

    
g_cSecondary menu_makecallback("c_Secondary")

    
g_cPrimary menu_makecallback("c_Primary")

}



public 
csdm_CfgInit()

{

    
// Config reader

    
csdm_reg_cfg("equip""cfgSetting")

    
// In order for weapon menu

    
csdm_reg_cfg("secondary""cfgSecondary")

    
csdm_reg_cfg("primary""cfgPrimary")

    
csdm_reg_cfg("botprimary""cfgBotPrim")

    
csdm_reg_cfg("botsecondary""cfgBotSec")

}



public 
plugin_init()

{

    
register_plugin(PLUGINNAMEVERSIONAUTHORS)

    

    
// Build Armor/Nade/Equip Menu's

    
buildMenu()

    

    
register_clcmd("say guns""enableMenu")

    
register_clcmd("say /guns""enableMenu")

    
register_clcmd("say menu""enableMenu")

    
register_clcmd("say enablemenu""enableMenu")

    
register_clcmd("say enable_menu""enableMenu")

}



public 
client_connect(id)

{

    
g_mShowuser[id] = true

    g_mNades
[id] = false

    g_mArmor
[id] = false

    g_Silenced
[id][SILENCED_M4A1] = false

    g_Silenced
[id][SILENCED_USP] = false

    

    
return PLUGIN_CONTINUE

}



public 
client_disconnect(id)

{

    
g_mShowuser[id] = true

    g_mNades
[id] = false

    g_mArmor
[id] = false

    

    
return PLUGIN_CONTINUE

}



public 
csdm_RemoveWeapon(ownerentity_idboxed_id)

{

    new 
classname[32], weapon

    
if (!pev_valid(entity_id))

    {

        return 
PLUGIN_CONTINUE

    
}

    
pev(entity_idpev_classnameclassname31)

    
weapon get_weaponid(classname)

    if (
weapon == CSW_M4A1)

    {

        
g_Silenced[owner][SILENCED_M4A1] = cs_get_weapon_silen(entity_id) ? true false

    
} else if (weapon == CSW_USP) {

        
g_Silenced[owner][SILENCED_USP] = cs_get_weapon_silen(entity_id) ? true false

    
}

    

    return 
PLUGIN_CONTINUE

}



public 
csdm_PostDeath(killervictimheadshot, const weapon[])

{

    
/* Clean up any defusal kits we might have made! */

    
if (!g_DefuseKit)

    {

        return

    }

    

    
/* This might have a race condition for team switches... */

    
if (cs_get_user_team(victim) == CS_TEAM_CT)

    {

        
cs_set_user_defuse(victim0)

    }

}



public 
cfgSecondary(readActionline[], section[])

{

    if (
readAction == CFG_READ)

    {

        if (
g_iNumSec >= MAX_SECONDARY)

            return 
PLUGIN_HANDLED

        

        
new wep[16], display[48], dis[4]

        new 
cmd[6]



        
parse(linewep15display47dis3)

        

        new 
disabled str_to_num(dis)

        

        
//Copy weapon into array

        
format(g_Secondary[g_iNumSec], 17"weapon_%s"wep)



        
g_DisabledSec[g_iNumSec] = disabled false true

        

        format
(cmd,5,"%d ",g_iNumSec)

        
g_iNumSec++

        

        
//TODO: Add menu_destroy_items to remake menu on cfg reload

        
menu_additem(g_SecMenuIDdisplaycmd0g_cSecondary)

    }

    else if (
readAction == CFG_RELOAD)

    {

        
g_SecMenuID menu_create(g_SecMenu"m_SecHandler"0)

        
g_iNumSec 0

    
}

    else if (
readAction == CFG_DONE)

    {

        
//Nothing for now

        
return PLUGIN_HANDLED

    
}

    

    return 
PLUGIN_HANDLED

}



public 
cfgPrimary(readActionline[], section[])

{

    if (
readAction == CFG_READ)

    {

        if (
g_iNumPrim >= MAX_PRIMARY)    

            return 
PLUGIN_HANDLED

            

        
new wep[16], display[48], dis[4]

        new 
cmd[6]



        
parse(linewep15display47dis3)

        

        new 
disabled str_to_num(dis)

        

        
//Copy weapon into array

        
format(g_Primary[g_iNumPrim], 17"weapon_%s"wep)

        
g_DisabledPrim[g_iNumPrim] = disabled false true

        

        format
(cmd5"%d"g_iNumPrim)

        
g_iNumPrim++

        

        
//TODO: Add menu_destroy_items to remake menu on cfg reload

        
menu_additem(g_PrimMenuIDdisplaycmd0g_cPrimary)

    } else if (
readAction == CFG_RELOAD) {

        
g_PrimMenuID menu_create(g_PrimMenu"m_PrimHandler"0)

        
g_iNumPrim 0

    
} else if (readAction == CFG_DONE) {

        
//Nothing for now

        
return PLUGIN_HANDLED

    
}

    

    return 
PLUGIN_HANDLED

}

    

    

public 
cfgBotPrim(readActionline[], section[])

{

    if (
readAction == CFG_READ)

    {

    

        new 
wep[16], display[32]



        
parse(linewep15display31)

        

        
//Copy weapon into array

        
format(g_BotPrim[g_iNumBotPrim], 17"weapon_%s"wep)

        
g_iNumBotPrim++

    } else if (
readAction == CFG_RELOAD) {

        
g_iNumBotPrim 0

    
} else if (readAction == CFG_DONE) {

        
//Nothing for now

        
return PLUGIN_HANDLED

    
}

    

    return 
PLUGIN_HANDLED

}



public 
cfgBotSec(readActionline[], section[])

{

    if (
readAction == CFG_READ)

    {

    

        new 
wep[16], display[32]



        
parse(linewep15display31)

        

        
//Copy weapon into array

        
format(g_BotSec[g_iNumBotSec], 17"weapon_%s"wep)

        
g_iNumBotSec++

    } else if (
readAction == CFG_RELOAD) {

        
g_iNumBotSec 0

    
} else if (readAction == CFG_DONE) {

        
//Nothing for now

        
return PLUGIN_HANDLED

    
}

    

    return 
PLUGIN_HANDLED

}



public 
cfgSetting(readActionline[], section[])

{

    if (
readAction == CFG_READ)

    {



        new 
setting[16], sign[3], value[6]



        
parse(linesetting15sign2value5)

        

        
// Menus settings

        
if (contain(setting,"menus") != -1)

        {

            if (
containi(value"p") != -1)

            {

                
g_mPrimStatus true

            
}

            

            if (
containi(value"s") != -1)

            {

                
g_mSecStatus true

            
}

            

            if (
containi(value"a") != -1)

            {

                
g_mArmorStatus true

            
}

            

            if (
containi(value"g") != -1)

            {

                
g_mNadeStatus true

            
}

            

            return 
PLUGIN_HANDLED

        
} else if (contain(setting"autoitems") != -1) {



            if (
containi(value"a")  != -1)

            {

                
//Disable Armor Menu

                
g_mArmorStatus false

                g_mAutoArmor 
true

                

                g_Armor 
1

            
}

                        

            if (
containi(value"h") != -1)

            {

                
//Disable Armor Menu

                
g_mArmorStatus false

                g_mAutoArmor 
true

                g_Armor 
2

            
}

            

            if (
containi(value"g") != -1)

            {

                
//Disable Grenade Menu

                
g_mNadeStatus false

                g_mAutoNades 
true

            
}

            

            if (
containi(value"d") != -1)

            {

                
g_DefuseKit true

            
}

            

            if (
containi(value"n") != -1)

            {

                
g_NightVision true

            
}

            

            return 
PLUGIN_HANDLED

        
} else if (contain(setting"grenades") != -1) {

            if (
containi(value"f") != -1)

            {

                
g_Flash true

            
}

            

            if (
containi(value"h") != -1)

            {

                
g_Nade true

            
}

            

            if (
containi(value"s") != -1)

            {

                
g_Smoke true

            
}

        } else if (
contain(setting"fnadesnum") != -1) {

            
fnadesnum str_to_num(value)

        }

        

        return 
PLUGIN_HANDLED

    
} else if (readAction == CFG_RELOAD) {

        
g_mArmorStatus false

        g_mNadeStatus 
false

        g_Flash 
false

        g_Nade 
false

        g_Smoke 
false

        g_Armor 
0

        g_mSecStatus 
false

        g_mPrimStatus 
false

        g_mAutoNades 
false

        g_DefuseKit 
false

        g_NightVision 
false

        fnadesnum 
1

    
} else if (readAction == CFG_DONE) {

        
//Nothing for now

        
return PLUGIN_HANDLED

    
}

    

    return 
PLUGIN_HANDLED

}



//Secondary Weapon Callback

public c_Secondary(idmenuitem)

{



    if( 
item ) return PLUGIN_CONTINUE

    

    
new cmd[6], iName[64]

    new 
accesscallback

    

    menu_item_getinfo
(menuitemaccesscmd,5iName63callback)

    

    new 
dis str_to_num(cmd)

    

    
//Check to see if item is disabled

    
if (g_DisabledSec[dis])

    {

        return 
ITEM_DISABLED

    
}

    else

    {

        return 
ITEM_ENABLED

    
}

    

    return 
PLUGIN_HANDLED

}



//Primary Weapon Callback

public c_Primary(idmenuitem)

{



    if (
item 0)

        return 
PLUGIN_CONTINUE

    

    
// Get item info

    
new cmd[6], iName[64]

    new 
accesscallback

    

    menu_item_getinfo
(menuitemaccesscmd,5iName63callback)

    

    new 
dis str_to_num(cmd)

    

    
//Check to see if item is disabled

    
if (g_DisabledPrim[dis])

    {

        return 
ITEM_DISABLED

    
}

    else

    {

        return 
ITEM_ENABLED

    
}

    

    return 
PLUGIN_HANDLED

}



//Equipment Menu handler

public m_EquipHandler(idmenuitem)

{

    if (
item 0)

    {

        return 
PLUGIN_CONTINUE

    
}

    

    
// Get item info

    
new cmd[2], iName[64]

    new 
accesscallback

    

    menu_item_getinfo
(menuitemaccesscmd1iName63callback)

    

    new 
choice str_to_num(cmd)

    

    switch(
choice)

    {

        case 
1:

        {

            if (
g_mSecStatus)

            {

                
menu_display(idg_SecMenuID0)

            }

            else if (
g_mPrimStatus)

            {

                
menu_display(idg_PrimMenuID0)

            }

            else if (
g_mArmorStatus)

            {

                
menu_display(idg_ArmorMenuID0)

            }

            else if (
g_mNadeStatus)

            {

                if (
g_mAutoArmor)

                {

                    
equipUser(idEQUIP_ARMOR)

                }

                
menu_display(idg_NadeMenuID0)

            } else {

                if (
g_mAutoArmor)

                {

                    
equipUser(idEQUIP_ARMOR)

                }

                if (
g_mAutoNades)

                {

                    
equipUser(idEQUIP_GREN)

                }

                
equipUser(idEQUIP_ITEMS)

            }

        }

        case 
2:

        {

            
// Equip person with last settings

            
equipUser(idEQUIP_ALL)

        }

        case 
3:

        {

            
g_mShowuser[id] = false

            client_print
(idprint_chat"[CSDM] Type ^"guns^" in chat to re-enable your equip menu.")

            
equipUser(idEQUIP_ALL)

        }

    }

    

    return 
PLUGIN_HANDLED

}



//Secondary Wep Menu handler

public m_SecHandler(idmenuitem)

{

    
// Get item info

    
new cmd[6], iName[64]

    new 
accesscallback

    

    menu_item_getinfo
(menuitemaccesscmd,5iName63callback)

    

    new 
wep str_to_num(cmd)

    

    
copy(g_SecWeapons[id],17,g_Secondary[wep])

    
equipUser(idEQUIP_SEC)

    

    
// Show next menu here

    

    
if (g_mPrimStatus)

    {

        
menu_display(idg_PrimMenuID0)

    }

    else if (
g_mArmorStatus)

    {

        
menu_display(idg_ArmorMenuID0)

    }

    else if (
g_mNadeStatus)

    {

        if (
g_mAutoArmor)

        {

            
equipUser(idEQUIP_ARMOR)

        }

        
menu_display(idg_NadeMenuID0)

    }

    else

    {

        if (
g_mAutoArmor)

        {

            
equipUser(idEQUIP_ARMOR)

        }

        if (
g_mAutoNades)

        {

            
equipUser(idEQUIP_GREN)

        }

        
equipUser(idEQUIP_ITEMS)

    }

    

    return 
PLUGIN_HANDLED

}



//Primary Wep Menu handler

public m_PrimHandler(idmenuitem)

{

    if (
item 0)  return PLUGIN_HANDLED

    

    
// Get item info

    
new cmd[6], iName[64]

    new 
accesscallback

    

    
if (menu_item_getinfo(menuitemaccesscmd,5iName63callback))

    {

        new 
wep str_to_num(cmd)

    

        
copy(g_PrimWeapons[id], 17g_Primary[wep])

        
equipUser(idEQUIP_PRI)

    }

        

    
// Show next menu here

        

    
if (g_mArmorStatus)

    {

        
menu_display(idg_ArmorMenuID0)

    }

    else if (
g_mNadeStatus)

    {

        if (
g_mAutoArmor)

        {

            
equipUser(idEQUIP_ARMOR)

        }

        
menu_display(idg_NadeMenuID0)

    } else {

        if (
g_mAutoArmor)

        {

            
equipUser(idEQUIP_ARMOR)

        }

        if (
g_mAutoNades)

        {

            
equipUser(idEQUIP_GREN)

        }

        
equipUser(idEQUIP_ITEMS)

    }

    

    return 
PLUGIN_HANDLED

}



//Armor Menu handler

public m_ArmorHandler(idmenuitem)

{

    if (
item 0) return PLUGIN_CONTINUE

    

    
// Get item info

    
new cmd[6], iName[64]

    new 
accesscallback



    menu_item_getinfo
(menuitemaccesscmd,5iName63callback)

    

    new 
choice str_to_num(cmd)

    

    if (
choice == 1)

    {

        
g_mArmor[id] = true

    
}

    else if (
choice == 2)

    {

        
g_mArmor[id] = false

    
}

    
equipUser(idEQUIP_ARMOR)

    

    
// Show next menu here

    

    
if (g_mNadeStatus)

    {

        
menu_display(idg_NadeMenuID0)

    } else {

        if (
g_mAutoNades)

        {

            
equipUser(idEQUIP_GREN)

        }

        
equipUser(idEQUIP_ITEMS)

    }

    

    return 
PLUGIN_HANDLED

}



//Nade Menu handler

public m_NadeHandler(idmenuitem)

{

    if (
item 0) return PLUGIN_CONTINUE

    

    
new cmd[6], iName[64]

    new 
accesscallback

    

    menu_item_getinfo
(menuitemaccesscmd5iName63callback)

    

    new 
choice str_to_num(cmd)

    

    if (
choice == 1)

    {

        
g_mNades[id] = true

    
}

    else if (
choice == 2)

    {

        
g_mNades[id] = false

    
}

    

    
equipUser(idEQUIP_GREN)

    
equipUser(idEQUIP_ITEMS)



    return 
PLUGIN_HANDLED

}



buildMenu()

{

    
//Equip Menu

    
menu_additem(g_EquipMenuID"New Weapons""1"0, -1)

    
menu_additem(g_EquipMenuID"Previous Setup""2"0, -1)

    
menu_additem(g_EquipMenuID"2+Don't show menu again""3"0, -1)

    
menu_setprop(g_EquipMenuIDMPROP_EXITMEXIT_NEVER)

    

    
//Armor Menu

    
menu_additem(g_ArmorMenuID"Yes, armor up""1"0, -1)

    
menu_additem(g_ArmorMenuID"No Armor""2"0, -1)

    
menu_setprop(g_ArmorMenuIDMPROP_EXITMEXIT_NEVER)

    

    
//Nade Menu

    
menu_additem(g_NadeMenuID"All Grenades""1"0, -1)

    
menu_additem(g_NadeMenuID"No Grenades""2"0, -1)

    
menu_setprop(g_NadeMenuIDMPROP_EXITMEXIT_NEVER)

    

    return 
PLUGIN_HANDLED

}



equipUser(idto)

{

    if (!
is_user_alive(id) )

        return

    

    if (
to EQUIP_SEC)

    {

        
//Give Secondary

        
GiveUserFullWeapon(idg_SecWeapons[id])

    }

    

    if (
to EQUIP_PRI)

    {

        
//Give Primary

        
GiveUserFullWeapon(idg_PrimWeapons[id])

    }

    

    if (
to EQUIP_ARMOR)

    {

        
//Give Armor

        
if (g_mAutoArmor || g_mArmor[id])

        {

            new 
armor g_mArmor[id] ? g_Armor

            cs_set_user_armor
(idDEFAULT_ARMORCsArmorType:armor)

        }

    }

    

    if (
to EQUIP_GREN)

    {

        
//Give Nades

        
if (g_mNades[id] || g_mAutoNades)

        {

                

            if (
g_Nade)

            {

                
GiveUserFullWeapon(id,"weapon_hegrenade")

            }

            

            if (
g_Smoke)

            {

                
GiveUserFullWeapon(id"weapon_smokegrenade")

            }

        

            if (
g_Flash && fnadesnum)

            {

                
GiveUserFullWeapon(id"weapon_flashbang")

                if (
fnadesnum == 2)

                {

                    
GiveUserFullWeapon(id"weapon_flashbang")

                }

            }



        }

    }

    

    if (
to EQUIP_ITEMS)

    {

        if (
g_DefuseKit && (cs_get_user_team(id) == CS_TEAM_CT))

        {

            
cs_set_user_defuse(id1)

        }

        if (
g_NightVision)

        {

            
cs_set_user_nvg(id1)

        }

    }

}



GiveUserFullWeapon(id, const wp[])

{

    
/** First check to make sure the user does not have a weapon in this slot */

    
new wpnid get_weaponid(wp)

    new 
weapons[MAX_WEAPONS], num

    
new name[24], weap

    
new slot

    
if (wpnid == 0)

    {

        if (
equal(wp"weapon_shield"))

        {

            
slot SLOT_PRIMARY

            wpnid 
= -1

        
}

    } else {

        
slot g_WeaponSlots[wpnid]

    }

    if ((
slot == SLOT_SECONDARY || slot == SLOT_PRIMARY)

         && 
wpnid 0)

    {

        
get_user_weapons(idweaponsnum)

        for (new 
i=0i<numi++)

        {

            
weap weapons[i]

            if (
weap == wpnid)

            {

                continue

            }

            if (
g_WeaponSlots[weap] == slot)

            {

                if (
slot == SLOT_SECONDARY && cs_get_user_shield(id))

                {

                    
//temporary fix!

                    
drop_with_shield(idweap)

                } else {

                    
get_weaponname(weapname23)

                    
csdm_force_drop(idname)

                }

            }

        }

    } else if (
slot == SLOT_PRIMARY && wpnid == -&& cs_get_user_shield(id)) {

        return

    }

    

    if (
slot == SLOT_PRIMARY && cs_get_user_shield(id) && wpnid 0)

    {

        
csdm_fwd_drop(id, -1"weapon_shield")

    }

    

    new 
item_id csdm_give_item(idwp)

    if (
item_id 0)

    {

        if (
wpnid == CSW_M4A1)

        {

            
cs_set_weapon_silen(item_idg_Silenced[id][SILENCED_M4A1], 1)

        } else if (
wpnid == CSW_USP) {

            
cs_set_weapon_silen(item_idg_Silenced[id][SILENCED_USP], 1)

        }

    }



    if (
wpnid 0)

    {

        new 
bpammo g_MaxBPAmmo[wpnid]

        if (
bpammo)

        {

            
cs_set_user_bpammo(idwpnidbpammo)

        }

    }

}



// MAIN FUNCTION OF THE PLUGIN

public csdm_PostSpawn(player)

{

    if (
is_user_bot(player))

    {

            new 
randPrim random_num(0g_iNumBotPrim-1)

            new 
randSec random_num(0g_iNumBotSec-1)

            

            
// By our lMOSTeast favorite guy KWo RIP - 02.11.2005.

            
new randArm random_num(02)

            new 
randGre random_num(02)

            

            
GiveUserFullWeapon(playerg_BotPrim[randPrim])

            
GiveUserFullWeapon(playerg_BotSec[randSec])



            
g_mArmor[player] = (g_mArmorStatus && randArm)

            
g_mNades[player] = (g_mNadeStatus && randGre)

    

            if (
g_mAutoArmor || g_mArmor[player])

            {

                
equipUser(playerEQUIP_ARMOR)

            }



            if (
g_mAutoNades || g_mNades[player])

            {

                
equipUser(playerEQUIP_GREN)

            }

            if (
g_DefuseKit)

            {

                
equipUser(playerEQUIP_ITEMS)

            }

    } else {

        if (
g_mShowuser[player])

        {

            
g_MenuState[player] = 1

            menu_display
(playerg_EquipMenuID0)

        } else {

            
g_MenuState[player] = 0

            equipUser
(playerEQUIP_ALL)

        }

    }

    

    return 
PLUGIN_CONTINUE

}



public 
enableMenu(id)

{

    if (!
csdm_active())

        return 
PLUGIN_CONTINUE

        

    
if (!g_mShowuser[id])

    {

        
g_mShowuser[id] = true

        client_print
(idprint_chat"[CSDM] Your equip menu has been re-enabled.")

        if (!
g_MenuState[id])

        {

            
g_MenuState[id] = 1

            menu_display
(idg_EquipMenuID0)

        }

    } else {

        
client_print(idprint_chat"[CSDM] Your equip menu is already enabled.")

    }

    

    return 
PLUGIN_HANDLED


PHP Code:
#include <amxmodx>

#include <csdm>

#include <cstrike>

#include <fakemeta>



new const g_weapons[] =

{

    
CSW_P228,

    
CSW_SCOUT,

    
CSW_XM1014,

    
CSW_MAC10,

    
CSW_AUG,

    
CSW_ELITE,

    
CSW_FIVESEVEN,

    
CSW_UMP45,

    
CSW_SG550,

    
CSW_GALI,

    
CSW_GALIL,

    
CSW_FAMAS,

    
CSW_USP,

    
CSW_GLOCK18,

    
CSW_AWP,

    
CSW_MP5NAVY,

    
CSW_M249,

    
CSW_M3,

    
CSW_M4A1,

    
CSW_TMP,

    
CSW_G3SG1,

    
CSW_DEAGLE,

    
CSW_SG552,

    
CSW_AK47,

    
CSW_P90

}



new const 
g_max_clip[] =

{

    
13,

    
10,

    
7,

    
30,

    
30,

    
30,

    
20,

    
25,

    
30,

    
35,

    
35,

    
25,

    
12,

    
20,

    
10,

    
30,

    
100,

    
8,

    
30,

    
30,

    
20,

    
7,

    
30,

    
30,

    
50

}



new const 
g_other_weapons[] =

{

    
CSW_KNIFE,

    
CSW_HEGRENADE,

    
CSW_C4

}



public 
plugin_init()

    
register_plugin("CSDM Refill""1.0""Radiance")



public 
client_death(killervictimwpnindexhitplaceTK)

{

    if (!
csdm_get_ffa() && TK)

        return



    for (new 
0sizeof (g_other_weapons); a++)

        if (
wpnindex == g_other_weapons[a])

            return



    new 
weapon fm_get_weapon_ent(killerwpnindex)



    for (new 
0sizeof (g_weapons); a++)

        if (
wpnindex == g_weapons[a])

        {

            new 
ammo get_weapon_maxclip(wpnindex)



            if (
ammo)

            {

                
client_cmd(killer"spk ^"items/9mmclip1.wav^"")

                
cs_set_weapon_ammo(weaponammo)

            }

            return



        }

}



get_weapon_maxclip(wpnid 0)

{

    for (new 
0sizeof (g_weapons); a++)

        if (
wpnid == g_weapons[a])

            return 
g_max_clip[a]



    return 
false

}



fm_get_weapon_ent(idwpnid 0)

{

    new 
name[32]



    if(
wpnid)

        
get_weaponname(wpnidname31)



    if (!
equal(name"weapon_"7))

        
format(namesizeof (name) - 1"weapon_%s"name)



    return 
fm_find_ent_by_owner(get_maxplayers(), nameid)

}



fm_find_ent_by_owner(id, const classname[], ownerjghgtype 0)

{

    new 
strtype[16] = "classname"

    
new ent id



    
switch (jghgtype)

    {

        case 
1strtype "target"

        
case 2strtype "targetname"

    
}



    while ((
ent engfunc(EngFunc_FindEntityByStringentstrtypeclassname)) && pev(entpev_owner) != owner)

    {

    }



    return 
ent



Last edited by giumbalau; 03-03-2021 at 13:26.
giumbalau is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-02-2021 , 13:44   Re: Run time error 10
Reply With Quote #2

Yes. The first step is providing the plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-02-2021 , 22:12   Re: Run time error 10
Reply With Quote #3

Also, enable debug for plugins that have errors so that you can post the more details that it provides.
__________________
fysiks is offline
giumbalau
Member
Join Date: Jan 2021
Old 03-03-2021 , 12:44   Re: Run time error 10
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Yes. The first step is providing the plugin.
done
giumbalau is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-03-2021 , 14:12   Re: Run time error 10
Reply With Quote #5

check if the killer's id is connected and he's not equal to the victim's id.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-04-2021 at 11:21.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
giumbalau
Member
Join Date: Jan 2021
Old 03-04-2021 , 06:43   Re: Run time error 10
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
check if killer id is connected and he's not the equal to the victim's id.
I don't know how to it.... i am not a scripter can you help me please ?
giumbalau is offline
Reply



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 18:26.


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