|
AlliedModders Donor
|
03-13-2021
, 21:29
Re: [TF2][REQ] Block Sticky Jumper & Rocket Jumper
|
#5
|
Not working
Quote:
Originally Posted by tair
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); }
|
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.
|
|
|
|