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

[TF2-REQUEST] Execute command every time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 02-18-2013 , 05:48   [TF2-REQUEST] Execute command every time
Reply With Quote #1

Can someone help me ? I think it's very simple to do that with Hook event but I can't found how too...

When a player respawn execute this command : sm_boost @me 9999999

When a player kill another one execute this command : sm_boost @me 9999999

Or is there anyway to execute a command each time ?

Here is the edited plugin of JagDragon (https://forums.alliedmods.net/showthread.php?p=965665) I just removed HUD and change one command name (sm_grant_critboost is now sm_boost)
Attached Files
File Type: sp Get Plugin or Get Source (CritPointsEDITED.sp - 353 views - 7.6 KB)

Last edited by Arkarr; 02-19-2013 at 02:06. Reason: Posted the plugin from JagDragon edited by me.
Arkarr is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 02-18-2013 , 14:24   Re: [TF2-REQUEST] Execute command every time
Reply With Quote #2

I dunno what sm_boost is, but if the 9999999 is seconds, it's probably redundant to apply it again when they kill someone. Oh well.

Keep in mind, they need access to the sm_boost command in order for this to work.

PHP Code:
#include <sourcemod>
#include <tf2_stocks>

public OnPluginStart()
{
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("player_death"Event_Death);
}

public 
Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client <= || client MaxClients) return;
    
FakeClientCommand(client"sm_boost @me 9999999");
}

public 
Action:Event_Death(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
GetEventInt(event"death_flags") & TF_DEATHFLAG_DEADRINGER) return;
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if (
attacker <= || attacker MaxClients) return;
    
FakeClientCommand(attacker"sm_boost @me 9999999");

Attached Files
File Type: sp Get Plugin or Get Source (boost.sp - 328 views - 758 Bytes)
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 02-19-2013 , 01:49   Re: [TF2-REQUEST] Execute command every time
Reply With Quote #3

Yeah ! You amazing ! But i got some probleme. In my plugin (who give you crits with weapons effect) when a medic heal a player he directly loose is crits :I Is there anyway to fix that with a nother Event ?

Last edited by Arkarr; 02-19-2013 at 02:23.
Arkarr is offline
Umbrozium
Junior Member
Join Date: Dec 2017
Location: ǝʌɐɹ
Old 01-22-2018 , 05:26   Re: [TF2-REQUEST] Execute command every time
Reply With Quote #4

Use Critical Hit Modifier plugin instead of sm_boost. Critical Hit Modifier increases player's crit chance ("sm_crits <player> 1" = 100% critical hit)
__________________
overmind searches for undermeanings
Umbrozium is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-22-2018 , 08:26   Re: [TF2-REQUEST] Execute command every time
Reply With Quote #5

Quote:
Originally Posted by Umbrozium View Post
Use Critical Hit Modifier plugin instead of sm_boost. Critical Hit Modifier increases player's crit chance ("sm_crits <player> 1" = 100% critical hit)
Look, I appreciate the help, really, but that necro bump was really necessary ? hahaha !
__________________
Want to check my plugins ?
Arkarr 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 12:13.


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