AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   TF2Items (https://forums.alliedmods.net/forumdisplay.php?f=146)
-   -   Sandman Ball (https://forums.alliedmods.net/showthread.php?t=302634)

KoltaiArmy 11-05-2017 06:34

Sandman Ball
 
Hi guys!
In tf2items.weapons.txt are there any way to set the ball of sandman to bonk the people again?

Walgrim 11-11-2017 07:45

Re: Sandman Ball
 
1 Attachment(s)
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.

Tim q 11-09-2021 14:05

Re: Sandman Ball
 
Nice its working


All times are GMT -4. The time now is 03:51.

Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.