Raised This Month: $7 Target: $400
 1% 

Sandman Ball


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KoltaiArmy
AlliedModders Donor
Join Date: Feb 2015
Location: Hungary
Old 11-05-2017 , 06:34   Sandman Ball
Reply With Quote #1

Hi guys!
In tf2items.weapons.txt are there any way to set the ball of sandman to bonk the people again?
__________________
KoltaiArmy is offline
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 - 1379 views - 2.1 KB)
__________________

Last edited by Walgrim; 05-03-2023 at 05:32.
Walgrim is offline
Tim q
Senior Member
Join Date: Aug 2020
Old 11-09-2021 , 14:05   Re: Sandman Ball
Reply With Quote #3

Nice its working
Tim q is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode