Job Setup

Hello,
I wanted to know how are you able to make a certain job have God Mode?
Thank You.

Here’s as short as it gets…

[lua]//
// Configuration Table.
//
local GOD_MODE_TEAMS = {
[ TEAM_ADMIN ] = true; – If your team CONSTs are ids, which is in 99% of game-modes, then use this line, otherwise comment it out. ( Crime City, TTT, DarkRP, etc )
– TEAM_ADMIN = true; – If your teams are STRINGs, rare, then uncomment this line. ( Unknown )
};

hook.Add( “PlayerShouldTakeDamage”, “TeamGodMode”, function( _victim, _attacker )
// If the victim is a valid entity, and is a player, and they’re on a team that shouldn’t take damage
if ( IsValid( _victim ) && _victim:IsPlayer( ) && GOD_MODE_TEAMS[ _victim:Team( ) ] ) then
// Prevent them from taking damage
return false;
end
end );[/lua]

Modified from this idea: https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/anti_teamkill_system.lua.html

Here is this example written in the same way with the helpful comments: https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/anti_damage_for_specific_teams_system.lua.html

Okay, thank you. I put this within the jobs.lua file correct?

Nope; put it in

addons/acecool/lua/autorun/server/godmode_teams.lua

Make sure you add your teams to the list following the pattern.

I don’t have a godmode_teams.lua.

[editline]1st June 2014[/editline]

In lua/autorun/server, I have forcedownload.lua and admin_functions.lua

Create those folders and then put it there.

Here, zipped; extract to your SERVER garrysmod/addons folder in a way that this path exists: garrysmod/addons/acecool/lua/autorun/server/godmode_teams.lua

https://dl.dropboxusercontent.com/u/26074909/tutoring/_zipped_code/acecool_godmode_teams.zip

Okay, extracted and imputed. I now don’t need to add

Correct?

[editline]1st June 2014[/editline]

I edited like this which I doubt is correct, is it?