View Single Post
jugule
AlliedModders Donor
Join Date: Apr 2020
Old 04-30-2020 , 12:18   Re: Problem with code
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
I can't see your whole code. Are you creating Stringmap CreateTrie() anywhere ?
No.

trie_armas full code

PHP Code:

Handle 
    attack_timer 
INVALID_HANDLE,
    
trie_armas;

public 
void Darm(int client)
{
    if(
IsPlayerAlive(client) && DuelEnabled)
    {
        
int weapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon");
        if(
weapon && (weapon == GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY) || weapon == GetPlayerWeaponSlot(clientCS_SLOT_SECONDARY)))
        {
            
int warray;
            
char classname[4];
            
//GetEdictClassname(weapon, classname, sizeof(classname));
            
Format(classname4"%i"GetEntProp(weaponProp_Send"m_iItemDefinitionIndex"));
            if(
GetTrieValue(trie_armasclassnamewarray))
            {
                if(
GetReserveAmmo(weapon) != warraySetEntProp(weaponProp_Send"m_iClip1"1);
            }
        }
    }
}

public 
Action EventItemPickup2(int clientint weapon)
{
    if(
weapon == GetPlayerWeaponSlot(clientCS_SLOT_PRIMARY) || weapon == GetPlayerWeaponSlot(clientCS_SLOT_SECONDARY) && DuelEnabled)
    {
        
int warray;
        
char classname[4];
        
//GetEdictClassname(weapon, classname, sizeof(classname));
        
Format(classname4"%i"GetEntProp(weaponProp_Send"m_iItemDefinitionIndex"));
        
        if(!
GetTrieValue(trie_armasclassnamewarray))
        {
            
warray GetEntProp(weaponProp_Send"m_iClip1");
            
            
SetTrieValue(trie_armasclassnamewarray);
        }
    }

full error

PHP Code:
 04/30/2020 19:19:24: [SMException reportedInvalid Handle 0 (error 4)
L 04/30/2020 19:19:24: [SMBlaminglss.smx
L 04
/30/2020 19:19:24: [SMCall stack trace:
L 04/30/2020 19:19:24: [SM]   [0GetTrieValue
L 04
/30/2020 19:19:24: [SM]   [1Line 882lss.sp::EventItemPickup2
L 04
/30/2020 19:19:24: [SM]   [3GivePlayerItem 

Last edited by jugule; 04-30-2020 at 12:20.
jugule is offline