Raised This Month: $ Target: $400
 0% 

[TF2] Any idea on making a addcond plugin that reactivates if you spawn?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-21-2016 , 12:51   Re: [TF2] Any idea on making a addcond plugin that reactivates if you spawn?
Reply With Quote #4

Quote:
Originally Posted by StormishJustice View Post
Oh thanks, i just did it like this but i'm not really sure because it gave me a tag mismatch on that line.

[...]

oh and i also hooked the event inside the spawncond command.
Coo'.
You're getting a mismatch because the tag is TFCond and not int:

Code:
TFCond iCondition;
I strongly recommend using TF2_AddCondition instead of modifying entity properties; the former has a greater chance of being future-proof, plus you can pass a duration value to it.

Also, the HookEvent() function would probably be better being called on plugin start just once; the event hook callback is fired on all matching events and not on any particular client (as SDKHooks does), so you'll need to make sure the client actually has a condition set.

On that note, there also isn't a default invalid value for TFCond, so use a nonexistent (e.g., negative) value for TFCond and check it before applying a condition to your players.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
 



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 21:11.


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