Hi,
Since an august update (don't know which), my plugin doesn't work anymore. To be precise, it make the server crash on the
GivePlayerItem(client, "weapon_c4");
It worked before without any problem, but now I can't find the right fix.
Here is the code :
Code:
public Action:CS_OnCSWeaponDrop(client, weapon)
{
if (IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client) && IsValidEdict(weapon))
{
decl String:sWeapon[64];
GetEdictClassname(weapon, sWeapon, 64);
if (StrEqual(sWeapon, "weapon_c4"))
{
g_iWeaponC4 = weapon;
CreateTimer(0.1, TimerDropBomb, client);
}
}
return Plugin_Continue;
}
public Action:TimerDropBomb(Handle:timer, any:client)
{
if (IsClientConnected(client) && IsClientInGame(client) && IsPlayerAlive(client) && IsValidEdict(g_iWeaponC4))
{
AcceptEntityInput(g_iWeaponC4, "kill");
GivePlayerItem(client, "weapon_c4");
}
}
I tried moving or removing the AcceptEntityInput, replacing it with a RemoveEdict, anyway those commands pass, it's always the
GivePlayerItem which crash. And other bomb plugins (like
Bomb Commands or
Request Bomb) work the same way (I don't know if they are broken too).
Could someone help me ?
__________________