View Single Post
ph
AlliedModders Donor
Join Date: Mar 2006
Old 03-13-2021 , 21:29   Re: [TF2][REQ] Block Sticky Jumper & Rocket Jumper
Reply With Quote #5

Not working

Quote:
Originally Posted by tair View Post
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 eventchar[] namebool 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(client0);
        
PrintToChat(client"[SM] Rocket Jumper is not allowed in this server!");
    }
    
    if(
hasSticky// Sticky Jumper
    
{
        
TF2_RemoveWeaponSlot(client1);
        
PrintToChat(client"[SM] Sticky Jumper is not allowed in this server!");
    }
}

int GetIndexOfWeaponSlot(int clientint slot) {
  return 
GetWeaponIndex(GetPlayerWeaponSlot(clientslot));
}

int GetWeaponIndex(int weapon) {
  return 
IsValidEnt(weapon) ? GetEntProp(weaponProp_Send"m_iItemDefinitionIndex") : -1;
}

bool IsValidEnt(int ent) {
  return 
ent MaxClients && IsValidEntity(ent);



Tested in game.

It seems that sticky and rocket jumper is still possible... any reasons why the plugin is not working.
__________________

Last edited by ph; 03-14-2021 at 05:51.
ph is offline