Skip to content

Commit

Permalink
Fixed #8 but found/created #10
Browse files Browse the repository at this point in the history
  • Loading branch information
kythre committed Aug 12, 2017
1 parent fe6eb57 commit 879967e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/ulx/modules/sh/sh_kyle_buildmode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _Kyle_Buildmode = _Kyle_Buildmode or {}

local function _kyle_Buildmode_Enable(z)
z:SendLua("GAMEMODE:AddNotify(\"Buildmode enabled. Type !pvp to disable\",NOTIFY_GENERIC, 5)")
if z:Alive() then
if z:Alive() then
ULib.getSpawnInfo( z )
if _Kyle_Buildmode["restrictweapons"]=="1" then
z:StripWeapons()
Expand All @@ -22,6 +22,8 @@ local function _kyle_Buildmode_Disable(z)

if (_Kyle_Buildmode["restrictweapons"]=="1" or _Kyle_Buildmode["killonpvp"]=="1") and not z:GetNWBool("_Kyle_BuildmodeOnSpawn") then
ULib.spawn( z, true ) --Gives the player their weapons they had before entering buildmode
else
z:ConCommand("kylebuildmode defaultloadout")
end


Expand Down
7 changes: 7 additions & 0 deletions lua/ulx/xgui/server/sv_kyle_buildmode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ hook.Add( "ULibReplicatedCvarChanged", "kylebuildmodecvar", function( v, w, x,
end)

concommand.Add("kylebuildmode", function( x, y, z )

if z[1]=="defaultloadout" then
gamemode.Call("PlayerLoadout", x)
return
end

if (x:query( "kylebuildmodesettings" )) then
if z[1]=="addweapon" then
table.insert(_Kyle_Buildmode["buildloadout"], z[2])
Expand All @@ -79,4 +85,5 @@ concommand.Add("kylebuildmode", function( x, y, z )
end
Save()
end

end)

0 comments on commit 879967e

Please sign in to comment.