local CATEGORY_NAME = "Advanced Simplicity"
function ulx.duel( ply, weapon, target )
ply:ChatPrint( target, "Challenged #T to a duel with #s.", weapon )
target:ChatPrint( ply, "#A challenged you to a duel with #s.", weapon )
hook.Add( "PlayerSay", "PlayerSayExample", function( ply, text, team )
if not ply == target or not text == "!accept" then return true end
sbox_godmode:GetConVar( "sbox_godmode" ) -- Gets original value of sbox_godmode, see after player death.
game.ConsoleCommand( "sbox_godmode 0" )
game.ConsoleCommand( "ulx god *" )
game.ConsoleCommand( ply, "ulx ungod #A,#T", target )
local function GM:SpawnMenuEnabled()
if ply:IsUserGroup( "superadmin" ) or target:IsUserGroup( "superadmin" ) then
return true
else
return false
end
end
ply:Give( weapon )
target:Give( weapon )
if weapon == "m9k_davy_crockett" or weapon == "m9k_orbital_strike" then
ply:ChatPrint( "Nice try getting past URS, Davy Crockets and Orbital Air Strikes are NOT allowed!" )
target:ChatPrint( "Nice try getting past URS, Davy Crockets and Orbital Air Strikes are NOT allowed!" )
end
PrintMessage( HUD_PRINTTALK, "Fight!" )
if not ply:IsAlive() or target:IsAlive() then
PrintMessage( HUD_PRINTTALK, "Duel over!" )
game.ConsoleCommand( "ulx ungod *" )
game.ConsoleCommand( "sbox_godmode" .. sbox_godmode:GetBool( "sbox_godmode" ) ) -- Checks the original value to set it back to the normal sbox_godmode.
local function GM:SpawnMenuEnabled()
return true
end
end
end )
end
local duel = ulx.command( CATEGORY_NAME, "ulx duel", ulx.duel, "!duel" )
duel:defaultAccess( ULib.ACCESS_ALL )
duel:addParam{ type = ULib.cmds.PlayerArg }
duel:help( "Duel a friend or enemy!" )