Quote:
Originally Posted by Bacardi
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(client, Prop_Data, "m_hActiveWeapon");
if(weapon > 0 && (weapon == GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY) || weapon == GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY)))
{
int warray;
char classname[4];
//GetEdictClassname(weapon, classname, sizeof(classname));
Format(classname, 4, "%i", GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"));
if(GetTrieValue(trie_armas, classname, warray))
{
if(GetReserveAmmo(weapon) != warray) SetEntProp(weapon, Prop_Send, "m_iClip1", 1);
}
}
}
}
public Action EventItemPickup2(int client, int weapon)
{
if(weapon == GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY) || weapon == GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY) && DuelEnabled)
{
int warray;
char classname[4];
//GetEdictClassname(weapon, classname, sizeof(classname));
Format(classname, 4, "%i", GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"));
if(!GetTrieValue(trie_armas, classname, warray))
{
warray = GetEntProp(weapon, Prop_Send, "m_iClip1");
SetTrieValue(trie_armas, classname, warray);
}
}
}
full error
PHP Code:
04/30/2020 - 19:19:24: [SM] Exception reported: Invalid Handle 0 (error 4)
L 04/30/2020 - 19:19:24: [SM] Blaming: lss.smx
L 04/30/2020 - 19:19:24: [SM] Call stack trace:
L 04/30/2020 - 19:19:24: [SM] [0] GetTrieValue
L 04/30/2020 - 19:19:24: [SM] [1] Line 882, lss.sp::EventItemPickup2
L 04/30/2020 - 19:19:24: [SM] [3] GivePlayerItem