Raised This Month: $51 Target: $400
 12% 

[TF2] Removing Sandman stun effect


Post New Thread Reply   
 
Thread Tools Display Modes
Darkimmortal
Senior Member
Join Date: Aug 2008
Old 03-04-2009 , 14:01   Re: [TF2] Removing Sandman stun effect
Reply With Quote #11

Quote:
Originally Posted by CrimsonGT View Post
I am considering writing a small MMS plugin that changes the stun to a daze effect if theres enough interest in it.
It would be even better if you were able to provide an option to simply prevent the effect entirely
Darkimmortal is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 03-04-2009 , 14:16   Re: [TF2] Removing Sandman stun effect
Reply With Quote #12

I would take a look at these 2 as a hold over until a way to remove them is found. You can also wack the entry from the /scripts/items/items.ctx file but that is a dirty hack.

sm_cvar tf_player_movement_stun_time 0
sm_cvar tf_scout_stunball_ball_regen_rate 300

This should make the stun time 0 and regen rate for the ball 5 mins.

-Teddy
__________________
Black Tusk Labs Home of Turbo TF2 and Turbo L4D:
http://blacktusklabs.com/ - Mah blog and stuff

My Crappy Plugins: SuperBuilds, Parent Buildables,
L4D Player Info
teddyruxpin is offline
HL-SDK
Member
Join Date: Jan 2009
Old 03-04-2009 , 19:29   Re: [TF2] Removing Sandman stun effect
Reply With Quote #13

I've heard tf_player_movement_stun_time has a MIN of 4 elsewhere on this forum.
HL-SDK is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 03-04-2009 , 20:50   Re: [TF2] Removing Sandman stun effect
Reply With Quote #14

You can change convar bounds with code.

SetConVarBounds(Handle:convar, ConVarBounds:type, bool:set, Float:value=0.0);
__________________
CrimsonGT is offline
HL-SDK
Member
Join Date: Jan 2009
Old 03-05-2009 , 10:04   Re: [TF2] Removing Sandman stun effect
Reply With Quote #15

That is pretty cool, I may try doing that instead of what I typed up last night. I haven't been able to test it yet - was updating the ded server.

Code:
/*  */
#include <sourcemod>
#include <tf2_stocks>
new Handle:cvarSandmanEnable = INVALID_HANDLE;
new Handle:cvarClass = INVALID_HANDLE;
 
public Plugin:myinfo = 
{
 name = "Strip Sandman",
 author = "HL-SDK",
 description = "<- Description ->",
 version = "0.1",
 url = "<- URL ->"
}
public OnPluginStart()
{
 HookEvent("player_spawn", event_PlayerSpawn);
 cvarSandmanEnable = CreateConVar("sm_sandman_enable", "1", "Enable/Disable the sandman", FCVAR_PLUGIN, true, 0.0, true, 1.0);
}
 
public Action:event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
 if (GetConVarInt(cvarSandmanEnable) == 0)
  return Plugin_Continue;
 new client = GetClientOfUserId(GetEventInt(event, "userid"));
 decl String:classString[32];
 GetConVarString(cvarClass, classString, sizeof(classString));
 new TFClassType:class = TF2_GetClass(classString);
 if (class == TFClass_Scout)
 {
  CreateTimer(0.1, timer_RemoveWeap, client);
 }
 return Plugin_Continue;
}
 
public Action:timer_RemoveWeap(Handle:timer, any:client)
{
 TF2_RemoveWeaponSlot(client, 2);
}
It is supposed to strip the scout's melee bucket, then I will re-equip it later. I'll also try changing the counds of that cvar.

On similar lines: I don't have the scout unlockables. Is there a command to unlock them all temporarily with sv_cheats 1?
HL-SDK is offline
Hfuhruhurr
Junior Member
Join Date: Nov 2008
Old 03-05-2009 , 15:36   Re: [TF2] Removing Sandman stun effect
Reply With Quote #16

This sounds very promising thanks for your effort HL-SDK it's very much appreciated.
Hfuhruhurr is offline
HL-SDK
Member
Join Date: Jan 2009
Old 03-05-2009 , 15:38   Re: [TF2] Removing Sandman stun effect
Reply With Quote #17

I tried changing bounds of tf_movement_player_Stun_time and verified that it was set to 0. I was still knocked to 3rd person and could not move.

Now I'm modding what I've posted so far to actually give a weapon for melee instead of depriving him of his oh-so-beloved bat.

Well with my ineperience, and bl4nk's pure awesome, I was able to mangle his givenameditem plugin so that whenever a player spawns, the plugin executes a servercommand.

I do it this way because I couldn't get the call_startfunction to pass the arguments correctly :'(

Feel free to look over what is 98% bl4nk's code in attachment. My addition was:
Code:
public Action:event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
 if (GetConVarInt(cvarSandmanEnable) == 1)
  return Plugin_Continue;
 new client = GetClientOfUserId(GetEventInt(event, "userid"));
 new userid = GetClientUserId(client);
 new String:weapString[32];
 GetConVarString(cvarWeap, weapString, sizeof(weapString));
 
 decl String:classString[32];
 GetConVarString(cvarClass, classString, sizeof(classString));
 
 new TFClassType:class = TF2_GetClass(classString);
 if (TF2_GetPlayerClass(client) == class)
 {
  ServerCommand("sm_givenameditem %s %s", userid, weapString);
 }
 return Plugin_Continue;
}
Attached Files
File Type: sp Get Plugin or Get Source (givenameditem_removesand.sp - 588 views - 4.2 KB)

Last edited by HL-SDK; 03-05-2009 at 17:04.
HL-SDK is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 03-06-2009 , 11:50   Re: [TF2] Removing Sandman stun effect
Reply With Quote #18

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
new Handle:gameConf;
new 
Handle:giveNamedItem;
new 
Handle:weaponEquip;
new 
Handle:g_hEnabled INVALID_HANDLE;
new 
bool:g_bEnabled true;
public 
OnPluginStart() {
    
gameConf LoadGameConfigFile("sandman.games");
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(gameConfSDKConf_Virtual"GiveNamedItem");
    
PrepSDKCall_AddParameter(SDKType_StringSDKPass_Pointer);
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
PrepSDKCall_SetReturnInfo(SDKType_CBaseEntitySDKPass_Plain);
    
giveNamedItem EndPrepSDKCall();
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(gameConfSDKConf_Virtual"WeaponEquip");
    
PrepSDKCall_AddParameter(SDKType_CBaseEntitySDKPass_Pointer);
    
weaponEquip EndPrepSDKCall();
    
g_hEnabled CreateConVar("sm_nosandman""1""Enable no sandman"FCVAR_PLUGIN|FCVAR_NOTIFY);
    
HookConVarChange(g_hEnabledCvar_enabled);
}
public 
OnMapStart() {
    
CreateTimer(5.0WpnCheck);
}
public 
OnConfigsExecuted() {
    
g_bEnabled GetConVarBool(g_hEnabled);
}
public 
Cvar_enabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
    
g_bEnabled GetConVarBool(g_hEnabled);
    if(
g_bEnabled) {
        
WpnCheck(INVALID_HANDLE);
    }
}
public 
Action:WpnCheck(Handle:timer) {
    new 
ent;
    
decl String:wpn[64];
    for(new 
i=1;i<=MaxClients;i++) {
        if(
IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i)) {
            if((
ent GetPlayerWeaponSlot(i2))!=-1) {
                
GetEdictClassname(entwpnsizeof(wpn));
                if(
StrEqual(wpn"tf_weapon_bat_wood")) {
                    
TF2_RemoveWeaponSlot(i2);
                    new 
entity SDKCall(giveNamedItemi"tf_weapon_bat"00);
                    
SDKCall(weaponEquipientity);
                    
PrintToChat(i"Your sandman has been removed.");
                }
            }
        }
    }
    if(
g_bEnabled) {
        
CreateTimer(5.0WpnCheck);
    }

Replaces a player's sandman with a normal bat.
Attached Files
File Type: sp Get Plugin or Get Source (sandman.sp - 808 views - 1.9 KB)
File Type: txt sandman.games.txt (195 Bytes, 290 views)

Last edited by MikeJS; 05-20-2009 at 10:50. Reason: engrish
MikeJS is offline
HL-SDK
Member
Join Date: Jan 2009
Old 03-06-2009 , 15:05   Re: [TF2] Removing Sandman stun effect
Reply With Quote #19

Quote:
Originally Posted by MikeJS View Post
Replaces a player's sandman with a normal bat.
*bow* *bow* *bow*

My hero! Now I see the right way to do it. Thank you, you are credit to team!
HL-SDK is offline
Balisong
Junior Member
Join Date: Jan 2009
Location: Canada
Old 03-09-2009 , 12:08   Re: [TF2] Removing Sandman stun effect
Reply With Quote #20

Thanks a lot for creating this plugin guys, and so fast !
I'll try this on my server right away
+ 1
__________________
Balisong is offline
Reply



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 16:04.


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