AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Multiple Buildings with pda & no extension (https://forums.alliedmods.net/showthread.php?t=300271)

shewowkees 08-11-2017 07:10

[TF2] Multiple Buildings with pda & no extension
 
1 Attachment(s)
Hello !

I don't know if this has been done before but this plugin allows you to quickly setup a game with a custom sentry/dispenser limit.

Other plugins have that feature what's different?
I haven't searched trough all of the internet but so far, i've seen three different ways to do that.
  • Spawning a building without the build command (needs a custom command which is less easy to use)
  • Editing some of the game's files which needs a server restart and provides no direct access through the pda.
  • Using a custom extension (the plugin which did that also needed two bots in the game)

Well this plugin here needs no server restart, no custom extension and directly uses the ingame pda

Cvars & Commands

Cvars
sm_sentry_limit How many sentries a single player can build.
sm_dispenser_limit Same but for the dispensers.

Commands:
sm_destroy_dispensers Destroy all the dispensers owned by the player who runs this command.
sm_destroy_sentries Same but for the sentries

Plugin in action:
https://www.youtube.com/watch?v=ByQGOWs4h-E

Changelog:
1.1:
  • Updated old comments
  • Fixed safety checks
  • Hooked clients on plugin start
Warning, the plugin hasn't his own config file, use your server.cfg instead.

FlaminSarge 08-11-2017 07:57

Re: [TF2] Multiple Buildings with pda & no extension
 
Okay, the sapper trick is really really neat. Nice find.

I don't think you need to cache the offset for m_hBuilder, I believe SM's GetEntProp already does offset caching.

I think you could probably pull out the instant upgrade functionality/cvar into a separate plugin, but I also thought that tf_fastbuild existed to provide the same functionality.

shewowkees 08-11-2017 08:06

Re: [TF2] Multiple Buildings with pda & no extension
 
Unfortunately, tf_fastbuild builds instantly but only to level 1, but this functionality is there because i need it for my server ^^.
Yeah actually i'm quite surprised the sapper trick doesn't screw the server up.
As for the GetEntProp thing, i had tried GetEntProp(i,Prop_send,"m_hBuilder") but since it's an handle it was returning me weird numbers. The only workaround i found was the offset caching. But if you know a cleaner way to do that please, tell me :)

FlaminSarge 08-11-2017 08:11

Re: [TF2] Multiple Buildings with pda & no extension
 
GetEntPropEnt?

Should update the inline comments for 'if player is not holding build box' instead of 'if player is holding wrench', etc. Was super confused for a bit there.

FlaminSarge 08-12-2017 00:37

Re: [TF2] Multiple Buildings with pda & no extension
 
You also need to add the weapon switch hook for all existing clients on plugin start (in the event of plugin reload)

The IsClientInGame safety check in the weapon switch hook should have a !

shewowkees 08-12-2017 06:49

Re: [TF2] Multiple Buildings with pda & no extension
 
Could you post an example of using GetEntPropEnt with an m_h... prop? I couldn't manage to get it working :/
Also yes i've updated the comments and the safety checks (what a stupid mistake for a last minute edit)...

FlaminSarge 08-15-2017 00:34

Re: [TF2] Multiple Buildings with pda & no extension
 
int client = GetEntPropEnt(object, Prop_Send, "m_hBuilder"); should work...

Some of those safety checks in there don't seem necessary. Why does the player's secondary weapon need to be valid (slot 1) for this to function, for example?

Dyou mind putting this up on GitHub or something?

Jillchang 10-30-2017 05:12

Re: [TF2] Multiple Buildings with pda & no extension
 
Can someone make this with a cfg file automated into cfg/sourcemod folder?

ThatKidWhoGames 11-02-2017 12:34

Re: [TF2] Multiple Buildings with pda & no extension
 
1 Attachment(s)
Quote:

Originally Posted by Jillchang (Post 2557539)
Can someone make this with a cfg file automated into cfg/sourcemod folder?

This should work

ktraintfc 03-08-2021 11:56

Re: [TF2] Multiple Buildings with pda & no extension
 
Great plugin! See in action @ -<ktrain's tf2 server>-

1. Can this be upgraded to also allow multiple teleporter entrances and exits?

thanks


All times are GMT -4. The time now is 00:36.

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