Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
Fix toolgun dropped when the player dies
  • Loading branch information
BattlefieldDuck committed Apr 17, 2019
1 parent f062f50 commit 8b1e70b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Binary file modified plugins/TF2Sandbox-ToolGun.smx
Binary file not shown.
18 changes: 17 additions & 1 deletion scripting/TF2Sandbox-ToolGun.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define DEBUG

#define PLUGIN_AUTHOR "BattlefieldDuck"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_VERSION "1.2"

#include <sourcemod>
#include <sdkhooks>
Expand Down Expand Up @@ -97,6 +97,22 @@ public void OnClientPutInServer(int client)
g_iCopyEntityRef[client] = INVALID_ENT_REFERENCE;
}

public void OnEntityCreated(int entity, const char[] classname)
{
if (StrEqual(classname, "tf_dropped_weapon"))
{
SDKHook(entity, SDKHook_SpawnPost, BlockToolGunDrop);
}
}

public void BlockToolGunDrop(int entity)
{
if(IsValidEntity(entity) && IsToolGun(entity))
{
AcceptEntityInput(entity, "Kill");
}
}

public Action Command_EquipToolGun(int client, int args)
{
if(client <= 0 || client > MaxClients || !IsClientInGame(client) || !IsPlayerAlive(client))
Expand Down

0 comments on commit 8b1e70b

Please sign in to comment.