Raised This Month: $130 Target: $400
 32% 

[TF2] Multiple Buildings with pda & no extension


Post New Thread Reply   
 
Thread Tools Display Modes
Author
shewowkees
Junior Member
Join Date: Apr 2017
Plugin ID:
5757
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 08-11-2017 , 07:10   [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #1

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (multiple_buildings.sp - 109 views - 5.7 KB)

    Last edited by shewowkees; 08-12-2017 at 06:51.
    shewowkees is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 08-11-2017 , 07:57   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #2

    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.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.
    FlaminSarge is offline
    shewowkees
    Junior Member
    Join Date: Apr 2017
    Old 08-11-2017 , 08:06   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #3

    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
    shewowkees is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 08-11-2017 , 08:11   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #4

    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.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 08-11-2017 at 08:15.
    FlaminSarge is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 08-12-2017 , 00:37   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #5

    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 !
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 08-12-2017 at 01:40.
    FlaminSarge is offline
    shewowkees
    Junior Member
    Join Date: Apr 2017
    Old 08-12-2017 , 06:49   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #6

    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)...
    shewowkees is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 08-15-2017 , 00:34   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #7

    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?
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 08-15-2017 at 00:35.
    FlaminSarge is offline
    Jillchang
    Senior Member
    Join Date: Mar 2014
    Old 10-30-2017 , 05:12   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #8

    Can someone make this with a cfg file automated into cfg/sourcemod folder?
    Jillchang is offline
    ThatKidWhoGames
    Senior Member
    Join Date: Jun 2013
    Location: IsValidClient()
    Old 11-02-2017 , 12:34   Re: [TF2] Multiple Buildings with pda & no extension
    Reply With Quote #9

    Quote:
    Originally Posted by Jillchang View Post
    Can someone make this with a cfg file automated into cfg/sourcemod folder?
    This should work
    Attached Files
    File Type: sp Get Plugin or Get Source (multiple_buildings.sp - 32 views - 5.8 KB)
    __________________


    I take custom plugin requests, add me on Steam for details.
    ThatKidWhoGames is offline
    Reply


    Thread Tools
    Display Modes

    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 22:01.


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