Here you go mate.
PHP Code:
#include <sourcemod>
#include <tf2_stocks>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Rocket & Sticky Jumper Blocker",
author = "Tair",
description = "Blocks: Rocket Jumper & Sticky Jumper",
version = "1.0",
url = "https://steamcommunity.com/id/Rarrawuo"
};
public void OnPluginStart()
{
HookEvent("post_inventory_application", OnResupply);
}
public Action OnResupply(Handle event, char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
bool hasRocket = (GetIndexOfWeaponSlot(client,0) == 237);
bool hasSticky = (GetIndexOfWeaponSlot(client,1) == 265);
if(hasRocket) // Rocket Jumper
{
TF2_RemoveWeaponSlot(client, 0);
PrintToChat(client, "[SM] Rocket Jumper is not allowed in this server!");
}
if(hasSticky) // Sticky Jumper
{
TF2_RemoveWeaponSlot(client, 1);
PrintToChat(client, "[SM] Sticky Jumper is not allowed in this server!");
}
}
int GetIndexOfWeaponSlot(int client, int slot) {
return GetWeaponIndex(GetPlayerWeaponSlot(client, slot));
}
int GetWeaponIndex(int weapon) {
return IsValidEnt(weapon) ? GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex") : -1;
}
bool IsValidEnt(int ent) {
return ent > MaxClients && IsValidEntity(ent);
}