• Help Coding Custom Gamemode
    7 replies, posted
i need someone to help me setup a custom version of the Murder Gamemode by Mechanical Mind i want to code in a way that if murder is played on a TTT map that the murderer has access to using the Traitor Triggers. is there a way to do this? thanks Add my Steam: lleto93
Just copy the code from the TTT gamemode and modify it per the Murderer team: [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/cl_tbuttons.lua[/url]
im new to this, can you break it down further [editline]20th July 2015[/editline] this is the murder files [url]https://github.com/mechanicalmind/murder/commit/4b9ce56f6901798754ec231f1c1cc588540edbb6[/url] this is what Code_gs sent me [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/cl_tbuttons.lua[/url] what do i do?
[QUOTE=NitroBeast;48255226]im new to this, can you break it down further [editline]20th July 2015[/editline] this is the murder files [url]https://github.com/mechanicalmind/murder/commit/4b9ce56f6901798754ec231f1c1cc588540edbb6[/url] this is what Code_gs sent me [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/cl_tbuttons.lua[/url] what do i do?[/QUOTE] You see in the code that code_gs sent you it has lines like [lua]LocalPlayer():IsActiveTraitor()[/lua]? That's using a TTT function to see if the player is a traitor or not. You just have to find how murder figures out who is a murderer and replace it in the code. Hope you understand
Yeah i think i understand the TTT code but the murder code is all over the place i cant figure any of it out
[QUOTE=NitroBeast;48255742]Yeah i think i understand the TTT code but the murder code is all over the place i cant figure any of it out[/QUOTE] There has to be an accessor to get if the player is a murderer or not. If the murderer is a team, then it will be LocalPlayer():Team() == TEAM_MURDERER.
I looked around in the murder code a little and it seems to use [lua]ply:GetMurderer()[/lua] (which I believe calls) [lua]function PlayerMeta:GetMurderer(bool) return self.Murderer end[/lua] as the call but I may be mistaken. I'm looking here [url]https://github.com/mechanicalmind/murder/blob/master/gamemode/sv_murderer.lua[/url]
[QUOTE=Chimpanzee;48258311]I looked around in the murder code a little and it seems to use [lua]ply:GetMurderer()[/lua] (which I believe calls) [lua]function PlayerMeta:GetMurderer(bool) return self.Murderer end[/lua] as the call but I may be mistaken. I'm looking here [url]https://github.com/mechanicalmind/murder/blob/master/gamemode/sv_murderer.lua[/url][/QUOTE] That's looks correct. Cut out the part of the code which code_gs sent you that takes away credits and replace all the things that check if the player :IsTraitor() with :GetMurderer(). This might or might not have complications though considering that function might be serverside only. Try it though. :)
Sorry, you need to Log In to post a reply to this thread.