• Half-Life 2 Roleplay Customization
    2 replies, posted
Yes, yes, I know that Facepunch-bandwaggoners hate HL2RP, but I'll try my luck nonetheless. Please don't smite me for it. Also, apologies if that has already been asked, I couldn't find any guides or help on Google. I'd appreciate any sort of links regarding this. So I've recently set up my server, Clockwork and all, the default version works just fine. But as any normal person I'd like to add custom factions to the gamemode, (such as the classic CWU) how would I accomplish this? I'm not very experienced in lua coding, I can understand most of the code and can edit small sections of it without entirely destroying everything, so I'm struggling there. Also, is there some sort of list of commands for this gamemode (like adding spawn points, the floating text, giving business privileges besides flags)? Things have changed since GMod 13. Thanks in advance.
Here's some commands: /textadd "text in quotes" 5 - Where 5 is the size of the text. /textremove - Will remove all text on the surface you are looking at. /spawnPointAdd faction - Usually if you just type in the first word of the faction's name it'll work. /spawnPointRemove faction - Look at the place where you made the faction's spawnpoint. Business privileges are done through the permits system, you buy a permit in the business menu. For factions, use this code and edit it to suit your needs: [CODE] local FACTION = Clockwork.faction:New("Faction name"); FACTION.isCombineFaction = true; -- Is this faction a combine faction? Combine factions can open Nexus doors and use Combine locks. Optional, default is false. FACTION.whitelist = true; -- If you need a whitelist to use this faction, use true. Otherwise use false. FACTION.models = { female = {"path/to/female.mdl","path/to/female2.mdl","path/to/etc"}, male = {"path/to/male.mdl","path/to/male2.mdl","path/to/etc"} }; FACTION_YOURFACTIONABBREVIATION = FACTION:Register(); [/CODE] Put it in the factions folder. For every faction, add a default class by using this code and putting it in the classes folder. [CODE] local CLASS = Clockwork.class:New("Metropolice Unit"); -- What the player will be classified as in the scoreboard. CLASS.color = Color(50, 100, 150, 255); -- RGBA color for chat CLASS.wages = 20; -- Paycheck CLASS.factions = {FACTION_YOURFACTIONABBREVIATION}; -- What faction uses this class? Make sure to match it with the faction you created above CLASS.isDefault = true; -- When a player makes a character with your faction, this is the class they are given automatically. CLASS.wagesName = "Supplies"; -- The upper-right hand corner text for "You have received n tokens (Supplies)". CLASS.description = "A metropolice unit working as Civil Protection."; -- The scoreboard description CLASS.defaultPhysDesc = "Wearing a metrocop jacket with a radio"; -- The default physical description (If the player didn't set one) CLASS_YOURCLASSABBREVIATION = CLASS:Register(); [/CODE] Add me on Steam if you need more help.
Ah, a template I can use, thanks. Otherwise I would probably have copypasted some civilian faction code and then edited it this way. This is much better. Also, thanks for the commands, that helps me a lot!
Sorry, you need to Log In to post a reply to this thread.