forked from UNLOZE/sm-plugins
entWatch4: Drop based on configured slot.
Dont drop if not configured, or knife.
This commit is contained in:
@@ -159,6 +159,7 @@ public void OnMapStart()
|
||||
config.iButtonID = hConfig.GetNum("buttonid");
|
||||
config.iTriggerID = hConfig.GetNum("triggerid");
|
||||
config.iDisplay = hConfig.GetNum("display");
|
||||
config.iSlot = hConfig.GetNum("slot");
|
||||
config.iMode = hConfig.GetNum("mode");
|
||||
config.iMaxUses = hConfig.GetNum("maxuses");
|
||||
config.iCooldown = hConfig.GetNum("cooldown");
|
||||
@@ -417,6 +418,11 @@ public void OnClientDisconnect(int client)
|
||||
|
||||
if (item.bClient && item.iClient == client)
|
||||
{
|
||||
if (item.bWeapon && !(item.dConfig.iSlot == SLOT_NONE || item.dConfig.iSlot == SLOT_KNIFE))
|
||||
{
|
||||
SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR);
|
||||
}
|
||||
|
||||
item.iClient = INVALID_ENT_REFERENCE;
|
||||
|
||||
Call_StartForward(g_hFwd_OnClientItemDisconnect);
|
||||
@@ -443,6 +449,11 @@ public void OnClientDeath(Event hEvent, const char[] sEvent, bool bDontBroadcast
|
||||
|
||||
if (item.bClient && item.iClient == client)
|
||||
{
|
||||
if (item.bWeapon && !(item.dConfig.iSlot == SLOT_NONE || item.dConfig.iSlot == SLOT_KNIFE))
|
||||
{
|
||||
SDKHooks_DropWeapon(item.iClient, item.iWeapon, NULL_VECTOR, NULL_VECTOR);
|
||||
}
|
||||
|
||||
item.iClient = INVALID_ENT_REFERENCE;
|
||||
|
||||
Call_StartForward(g_hFwd_OnClientItemDeath);
|
||||
|
||||
Reference in New Issue
Block a user