I'm having an issue with my server crashing whenever I use GivePlayerItem in a plugin.
This is what crashes it:
PHP Code:
public void GiveStartingWeapons()
{
for(int i = 1; i <= MaxClients; i++)
{
if(!IsValidClient(i)) continue;
if(g_hCV_GiveArmor.BoolValue)
SetEntProp(i, Prop_Send, "m_ArmorValue", 100, 1);
/*if(g_hCV_GiveHelmet.BoolValue)
GivePlayerItem(i, "item_assaultsuit");
if(g_hCV_GiveSmoke.BoolValue)
GivePlayerItem(i, "weapon_smokegrenade");
if(g_hCV_GiveHE.BoolValue)
GivePlayerItem(i, "weapon_hegrenade");
if(g_hCV_GiveFlash.BoolValue)
GivePlayerItem(i, "weapon_flashbang");*/
if(g_hCV_GiveDecoy.BoolValue)
GivePlayerItem(i, "weapon_decoy");
}
}
If I comment out the last two lines of that function it sets armor value as expected and works just fine. I've tried using a different plugin that uses GivePlayerItem and that also crashes so I'm wondering if the offset for GiveNamedItem has changed? I have the latest SM and I haven't seen anyone else having issues with this so I'm really confused.
Here's an Accelerator crash dump if it helps:
https://crash.limetech.org/zxz4autwj7wq