Thread: Sandman Ball
View Single Post
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 11-11-2017 , 07:45   Re: Sandman Ball
Reply With Quote #2

Hey, I don't think there's a way to set the old bonk with tf2items (in tf2items.weapons.txt).
If you really want to get the bonk back you can use the plugin I did if you want:
PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <tf2_stocks>

public Plugin myinfo =
{
    
name "[TF2] Bonk",
    
author "Walgrim",
    
description "Bonk is back on Sandman.",
    
version "1.0",
    
url "http://steamcommunity.com/id/walgrim/"
};

public 
OnClientPutInServer(client) {
  if (
IsClientInGame(client)) {
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
  }
}

public 
Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3], damagecustom) {
  new 
wepindex = (IsValidEntity(weapon) && weapon MaxClients GetEntProp(weaponProp_Send"m_iItemDefinitionIndex") : -1);
  if (
wepindex == 44) {
        
decl Float:fClientLocation[3], Float:fClientEyePosition[3];
        
GetClientAbsOrigin(attackerfClientEyePosition);
        
GetClientAbsOrigin(clientfClientLocation);

        
decl Float:fDistance[3];
        
MakeVectorFromPoints(fClientLocationfClientEyePositionfDistance);
        
float dist GetVectorLength(fDistance);
        
//PrintToChat(attacker, "\x04Distance: %2.f", dist); //See the distances between the ball and the client.
        
if (dist >= 128.0 && dist <= 256.0) {
            
TF2_StunPlayer(client1.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 256.0 && dist 512.0) {
            
TF2_StunPlayer(client2.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 512.0 && dist 768.0) {
            
TF2_StunPlayer(client3.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 768.0 && dist 1024.0) {
            
TF2_StunPlayer(client4.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 1024.0 && dist 1280.0) {
            
TF2_StunPlayer(client5.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 1280.0 && dist 1536.0) {
            
TF2_StunPlayer(client6.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 1536.0 && dist 1792.0) {
            
TF2_StunPlayer(client7.00.0TF_STUNFLAGS_SMALLBONKattacker);
        }
        else if (
dist >= 1792.0) {
            
TF2_StunPlayer(client7.00.0TF_STUNFLAGS_BIGBONKattacker);
        }
  }
  return 
Plugin_Changed;

I used the wiki page to set the distances: https://wiki.teamfortress.com/wiki/Stun#Speed
Not really sure it's the best way to do that but it works well actually.
If you're lazy I attached the plugin.

EDIT: I published a new version here.
Attached Files
File Type: sp Get Plugin or Get Source (bonk.sp - 1404 views - 2.1 KB)
__________________

Last edited by Walgrim; 05-03-2023 at 05:32.
Walgrim is offline