1. Check out the Store if you're looking to Buy HL2RP or other schemas for your server. You can click Buy Schemas on the very top navigation bar to visit the store.
  2. Use the Plugin Center to easily subscribe to and auto-install Clockwork plugins to your server, or submit and share plugins you have developed.
  3. Having trouble setting up or developing with Clockwork? Check out the Wiki or post in the Support Forum for advice from fellow users.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Gr4Ss' plugin thread v2

Discussion in 'Plugins' started by Gr4Ss, Apr 30, 2016.

  1. ARMORED CLOTHES v1.1
    direct download - plugin center (tba)​
    A slightly updated version of the old Armor plugin. It provides an Armored Clothes Base that has the option to give kevlar and/or protection to players. Also includes gasmask/rebreather support and includes customizable clothes so you can easily create unique armored clothes items in-game.
    A full overview of the features:
    • Armored Clothes Base that adds pocket space, armor and protection onto the regular Clockwork clothes base. Armor-saving has been updated and should be more reliable in this version.
    • Customizable Armored Clothes Base that allows you to create unique items in-game.
    • Gasmask and Rebreathers are included for use with the Gas Zones plugin. This has been updated a bit to make extending this easier (e.g. non-clothes gasmasks). Filter saving also got updated and should be much more reliable (if it fucks up now, it is a CW issue).
    • The possibility for clothes to conceal a character's identity. (credits to Zombine for adding this in).
    • Fully compatible with most items from the old armor plugin.
    Note: for gasmasks and rebreathers to do anything useful you need the Gas Zones plugin.
    Note: for the gasmask textures to work you need to add the materials to your server as well. Download them here (extract the zip file to your server into /garrysmod/).
    Note: for filters to work, you need the equipable item plugin. Either grab it from the plugin center or download it from the direct download.


    ID CARDS
    direct download - plugin center (tba)​
    Adds in relatively simple ID Card items, that are personalized to the player owning them. Comes with some pre-existing items that you can use as examples.
    A quick overview of the features:
    • Cards have the owner's name, CID and a unique random card number on them.
    • Simply add 'FACTION.giveCard = "insert_card_uniqueID_here";' to the faction file and all players on that faction will be automatically given a card.
    • Cards can also be handed out and the player will be made to own it when he picks it up.
    • The plugin tracks the player's currently owned card by its itemID.
    • Adds GetCardText() and HasUnionCard(bAllowCitizens) to the playerMeta for the developers among you. You can easily update datafiles/union locks to use this. GetCardText returns the card's number, HasUnionCard returns true if the player has a card (and owns that card) with ITEM.canOpenUnionLock set to true (if bAllowCitizens is false it will check for ITEM.canOpenRestrictedUnionLock instead).
    NOTE: just to make it clear, this does not work with union locks out of the box. If you know how to code, this plugin just makes it easy for you to make it work with Union locks. If you do not know how to code, you can still use this plugin to have nice cid card items...

    GAS ZONES v2
    direct download - plugin center (tba)​
    A working gas zones plugin that does what you expect gas zones to do: kill people inside of them unless they are wearing a gasmask.
    A full overview of the features:
    • Support gasmasks and rebreathers from the Armored Clothes plugin.
    • Some simple chat message to alert players when they are entering/leaving a gas zone and when taking damage from gas.
    • Admin console logging when someone dies to gas.
    • Config option for filter drain scale and damage per second.
    • Scaleable zones: higher scale = more gas = more damage/faster filter drain
    • 'No Gas Zones': in case you want to make a safe area within a gas zone, you can do so without having to build boxes around it.
    • ESP for super admins to easily setup and manage the zones.
    • Code can easily be edited to make the zone checks client-side, lessening CPU load on the server and allowing a lower zone ticktime. This means players get feedback about entering/leaving a gas zone more quickly. Does come at a potential increase in networking load. By default it is set to server-side.
    • Ticktime is easily edited to make zones update faster/slower. Default is 2 seconds (aka zones will be checked for a player every two seconds). Default client-side zone ticktime is 1 second (aka zones will be checked every second, but damage/filter drain is still done server-side at a rate of once every two seconds).
    • Simple, readable code that is not likely to break. The entire plugin is only 106 lines of code (including blank lines, trivial variable assignments, 'end's, etc.).
    Note: this plugin does require the Zones plugin to work!
    Note: Gasmasks are not included with this plugin, you need the Armored Clothes plugin installed as well for that.


    WAYPOINTS
    direct download - plugin center (tba)​
    A small plugin that allow some factions to use waypoints. To just list the features:
    • Add one or more of the following to a faction's file (what they do is quite self-explanatory):
      • FACTION.canSeeWaypoints = true;
      • FACTION.canAddWaypoints = true;
      • FACTION.canRemoveWaypoints = true;
      • FACTION.canUpdateWaypoints = true;
      Players can still remove/update their own waypoints without their faction having Remove/Update permissions.
    • Makes it easy to add waypoints script-wise with a global library function (in case you for example want to create a waypoint where a player died).
    • Waypoints can have some text.
    • Waypoints can have different colors and can be made to last for a certain amount of time.
    • Waypoint markers draw through walls and include a distance to them in meters. It is also possible to add waypoints without a distance marker.
    • Waypoints will visually change a bit when a player can see the actual location.
    • Players joining will see waypoints created before they joined if they should see them. Everything updates quite nicely.
    • No texture download needed, waypoint is just drawn with lines and rectangles.

    ZONES
    direct download - plugin center (tba)​
    A generic zones plugin for the developers among us. Ever wanted to do something with zones but couldn't be bothered writing all that code to create, save, load and check zones? With this plugin that no longer is an issue. All you have to do from now on is write the functions to do what needs to be done when a player enters/leaves a zone or what has to be done every tick. On top of that the plugin provides a lot of utility to make whatever you wanted to make even better!
    A full overview of the features:
    • Register zones by simply filling out a table with options and passing the needed functions along. The zones plugin will automatically create the commands to add/remove zones, take care of saving and loading them, doing all the networking in case you wish for shared variables or client-side zones... Basically all you have to do is code in what the zone has to do.
    • The function to register a zone is well documented so it is easy for you to figure out what value does what. Function headers are included as well so you know what your functions will be called with.
    • A quick overview of some of the options: zone name, tickTime (can differ on client and server!), use exclusion areas or not, use a scale for every area, do zone checks clientside, network the results of zone checks, set a shared var to share zone check results with ALL clients...
    • A quick overview of some of the functions you can provide: what to do after every zone check tick, what to do whenever a player changes area or enters/leaves the zone, when to do zone checks, what to display on the admin ESP, custom data to attach to an area upon creation...
    • There is an ESP available for super admins. When registering a zone you can specify the color of the zone. This ESP will only draw when the admin ESP normally draws and has a checkbox so it can be turned off without having to turn of the default admin ESP.
    • It's been optimized as well as a plugin like this can be optimized.
    Note: this plugin does NOT work with auto refresh at the moment so make sure you disable it when running this plugin on your server. I may try to fix this in the future but it is relatively low priority as there is very little reason to have auto refresh turned on on a live server.

    NOTES
    SUPPORT
    I am always willing to give support in case my plugins break or help you get started with my plugins. However, I do ask you to read any instructions/readme/notes before you come to me. You can preferably contact me through a forum PM or by replying to this thread. Consider adding me on steam as more of a last resort. If everyone starts adding me I end up getting a lot of friend requests from people I never heard of before, and then several people start messaging me on steam every day for help which gets annoying fast.

    Also note that not all of my plugins are plug and play and some are either made purely for other GMod Lua developers out there (and thus are totally useless to you if you do not know how to code) or require a basic ability to create/edit item files to be worth anything. If the latter is an issue for you, then I suggest that you find a developer for your server first instead of contacting me.

    LICENSE
    [​IMG]
    All the plugins published here are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

    For all the developers out there who are too lazy to click the link above, this means you are free to use, modify and redistribute my plugins as long as you properly credit me and share it again under the same license.

    DONATIONS
    In case you do feel generous and want to give me some of your shekels, you can always do so through paypal.
     
    • Like Like x 6
    • Good Coder Good Coder x 2
    • Friendly Friendly x 1
    Last edited: May 9, 2016
  2. Svensis

    Svensis Guest

    When I try to add a gaszone, I get.
    [ERROR] gamemodes/cwhl2rp/plugins/zones/plugin/cl_hooks.lua:30: attempt to index a nil value
    1. unknown - gamemodes/cwhl2rp/plugins/zones/plugin/cl_hooks.lua:30
    2. func - gamemodes/clockwork/framework/libraries/sh_datastream.lua:160
    3. unknown - lua/includes/extensions/net.lua:32
     
  3. I'll have a look, might be I fucked something up when removing debug stuff.

    Edit: mind elaborating on what you were doing when you got that error? The error can only happen when the server networks the serverside zones to Superadmins when they connect (somewhere while they are on Clockwork is initializing...) and definitely not when you are adding in a gas zone.
     
    Last edited: May 1, 2016
  4. Just updated the zones plugin. Should have fixed the errors that were happening. IT was happening because I assume someone at some point decided to remove a few hook calls from CW which resulted in zones not being registered clientside, which I didn't notice because I run an old version. Using default GMod hooks now so it's all fixed.

    Also noticed a small bug where if you were adding an area to a zone that uses scales it wouldn't always be added.

    Just redownload it from the link and overwrite the files.
     
    • Like Like x 2
    • Good Coder Good Coder x 2
    Last edited: May 1, 2016
  5. noel

    noel Active Member

    So, is there a way I can use the Zones plugin in order to get that transfer from the City to Outlands as aforementioned?
     
  6. Not yet unless you want to do some coding yourself. I still got to make a server portals plugin (which will use the zones plugin because the portals are zones in a sense).

    I made the Zones plugin because I had three plugins that basically had 50-70% the same code and there were a bunch more I wanted to make that would have zones too... But now I have the Zones plugin and can just build the rest on top of it, I only need some time to do so.
     
    • Good Coder Good Coder x 1
  7. noel

    noel Active Member

    Alright fair enough, probably not capable of doing it myself, but if there's anything I can offer you ($$$$$$$$$$) to speed up the process, that'd be nice.
     
  8. karl-police

    karl-police Hotrod turret Active Member

    Post the locks fix for industrial :)
     
  9. Will eventually come around to it, got a server to launch first.
     
    • Winner Winner x 1
    • Friendly Friendly x 1
  10. Added two more plugins in case anyone wants them...
     
    • Good Coder Good Coder x 1
  11. Svensis

    Svensis Guest

    thank you
     
  12. And also uploaded a fix for gaszones. Only the sh_plugin got updated, it wasn't checking FACTION.noGas
     
    • Good Coder Good Coder x 1
  13. Darklord

    Darklord Clockwork Customer Active Member

    Will i lose my gazsone at my map if i update the gaszones?
     
  14. Nope. The zones aren't even tracked by the gaszones plugin anymore so... It's safe to overwrite

    Edit: and also fixed a small potential bug where a filter wouldn't properly unequip after a charswap in the armor plugin. Change is in sv_hooks in case you don't want to overwrite all the files.
     
    • Disagree Disagree x 1
    Last edited: May 8, 2016
  15. Darklord

    Darklord Clockwork Customer Active Member

    I appreciate that u made this plugin but there is some issues like , u cant un-screw the filter when you wear it :p
     
  16. Darklord

    Darklord Clockwork Customer Active Member

    Annnndddddd I losed the gaszones in my map :/:(
     
  17. Something on your end... It updated on nebulous and my dev server without a problem. And I haven't heard of people not being able to unscrew their filter yet. Even just tried and it's working fine.
     
    • Like Like x 1
  18. sparkz

    sparkz pay your fucking devs kuro Clockwork Customer Active Member

    I have no idea how to figure out this damn gasmask thing.
    You should make a guide to editing it or something because I am clueless. I don't want models changing or anything when you put on a mask. I don't see filters as an item either.
     
    Last edited: May 9, 2016
  19. Roth

    Roth C16's furfag mascot (better than Cinder) Active Member

    you'll ned to fix the thing where you have to take off the filter first though. yesterday during the event people couldn't take off their suits and they were panicking lol
     
  20. Actually is a good idea. Updated the armored clothes base with that.

    Also I just noticed that I entirely forgot to state anywhere you need the equipable item plugin for filters to work properly, so I added that to the drive as well.

    Models on gasmasks work exactly like normal CW clothes do. If you want clothes that don't change the model you can use this:
    Code:
    function ITEM:GetReplacement(player)
        if (SERVER) then
            return player:GetDefaultModel();
        else
            return player:GetModel();
        end;
    end;
     
    • Like Like x 1
    • Good Coder Good Coder x 1