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

[TF2] Adding conditions...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lostprophetpunk
Member
Join Date: Oct 2012
Old 01-16-2014 , 06:13   [TF2] Adding conditions...
Reply With Quote #1

Heya there,

I am just wondering if there was a way to do the following command, and get it working for everyone on the server.
PHP Code:
TF2_AddCondition(clientTFCond:TFCond_Milked80); 
As soon as I stick the following line to a function, the command no longer works for non-admins. Is there a way around this?

Also on a side note. Is there a list of attributes I can use via Prop_Send?
lostprophetpunk is offline
NIGathan
Senior Member
Join Date: Aug 2011
Location: /dev/null
Old 01-16-2014 , 08:49   Re: [TF2] Adding conditions...
Reply With Quote #2

This is what I use.

PHP Code:
public OnPluginStart()
{   
    
RegConsoleCmd("sm_milkme"Command_Milk)
}

public 
Action:Command_Milk(clientargs)
{
    if (
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
TF2_AddCondition(clientTFCond:27float(float(1)));
    }
    return 
Plugin_Handled;

Note the duration is set to 1.0 second. Actually, this is a trick to make the effect last indefinitely. I don't understand why, but when you cast a float as a float, at least with my sourcemod setup (I might be using an old sdk), it makes it last forever. If it only lasts for a second for you, just change the "float(float(1))" to something like "9000.1"
NIGathan is offline
lostprophetpunk
Member
Join Date: Oct 2012
Old 01-16-2014 , 09:09   Re: [TF2] Adding conditions...
Reply With Quote #3

I found out where I went wrong. I left some code in the plugin which was unused and was causing the error. I also didn't load the common phrases.
lostprophetpunk 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 03:45.


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