Author Topic: Individual group god mode?  (Read 4078 times)

0 Members and 1 Guest are viewing this topic.

Offline Sc00by22

  • Jr. Member
  • **
  • Posts: 98
  • Karma: 0
Individual group god mode?
« on: May 04, 2008, 01:45:34 AM »
Is there a way to make a group god moded? My server default is not god mode, It would be nice if we could so I can give my Donators group god mode :D

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Individual group god mode?
« Reply #1 on: May 04, 2008, 08:04:59 AM »
Here you go:

Code: [Select]
if SERVER then
function GodGroup( ply )
if ply:IsUserGroup("GroupNameHere") then  -- Just place the name of whatever group you want goded here.
game.ConsoleCommand( "ulx god " ..ply:Nick().. " \n" )
Msg( "Granted " ..ply:Nick().. " Godmode \n" )
end
end
hook.Add( "PlayerSpawn", "GodGroup", GodGroup )

Not tested but should work. To use, just save it as "anything.lua" and place it in your server gmod_root/lua/autorun.

==EDIT==
Does ULib have a function like ULib.god(ply)?
« Last Edit: May 04, 2008, 08:15:27 AM by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Individual group god mode?
« Reply #2 on: May 04, 2008, 09:55:31 AM »
==EDIT==
Does ULib have a function like ULib.god(ply)?

ULib has no function for that. Gmod has a player.GodEnable() function already which is what ULX's god function uses, plus the logging and tagging for other functions. There was no reason to modify or enhance it, so we didn't duplicate it.
« Last Edit: May 04, 2008, 09:57:15 AM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Individual group god mode?
« Reply #3 on: May 04, 2008, 10:22:31 AM »
Ok, cool thanks.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly