ULX

Author Topic: Need help with some custom commands (minor error in my syntax)  (Read 1798 times)

0 Members and 1 Guest are viewing this topic.

Offline splerge

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Hey guys! made some custom commands on my gameserver. When i reload the server, my gmod instantly gets the error (from this lua file)
"error near 'nuke' on line 69: missing ')'
now as far as i can tell there isn't any missing brackets, so can someone have a look and see why my problem is?
Code: [Select]
----------------------------------------!spawn --------------------------------------------------

function ulx.spawn( calling_ply, target_plys )
local affected_plys = {}
for k,v in pairs(target_plys) do
if !v:Alive() then
nz.Rounds.Functions.ReSpawn(v)
table.insert(affected_plys, v)
else
ULib.tsayError( calling_ply, v:Nick() .. " is alive or spectating!", true )
end
end
ulx.fancyLogAdmin( calling_ply, "#A respawned #T", affected_plys )
end
local spawn = ulx.command( "Utility", "ulx spawn", ulx.spawn, "!spawn" )
spawn:addParam{ type=ULib.cmds.PlayersArg }
spawn:defaultAccess( ULib.ACCESS_ADMIN )
spawn:help( "Spawns target(s)." )

----------------------------------------!points <players> x--------------------------------------------

function ulx.points( calling_ply, target_plys, amount )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if v:Alive() then
v:GivePoints(amount)
table.insert(affected_plys, v)
end
end
ulx.fancyLogAdmin( calling_ply, "#A gave #i points to #T", amount, affected_plys )
end
local points = ulx.command( "Utility", "ulx points", ulx.points, "!points" )
points:addParam{ type=ULib.cmds.PlayersArg }
points:defaultAccess( ULib.ACCESS_SUPERADMIN )
points:addParam{ type=ULib.cmds.NumArg, min=1, default=1000000, hint="points", ULib.cmds.round }
spawn:help( "Sets the amount of points for the target(s)." )

---------------------------------------------------------------------------------------------------------

function ulx.ready( calling_ply, target_plys )
local affected_plys = {}
for k,v in pairs(target_plys) do
if !v:Alive() then

nz.Rounds.Functions.ReadyUp(v)
table.insert(affected_plys, v)
end
end
ulx.fancyLogAdmin( calling_ply, "#A readied #T", affected_plys )
end
local ready = ulx.command( "Utility", "ulx ready", ulx.ready, "!ready" )
ready:addParam{ type=ULib.cmds.PlayersArg }
ready:defaultAccess( ULib.ACCESS_ADMIN )
ready:help( "Readies the target(s)" )

--------------------------------------------------------------------------------------------------------
function ulx.nuke()

nz.PowerUps.Functions.Nuke()
for k,v in pairs(player.GetAll()) do
if v:Alive() then
v:TakePoints(500)
end
end
ulx.fancyLogAdmin( calling_ply, "#A dropped a nuke on the zombies!" )
end

local nuke = ulx.command( "Utility", "ulx nuke", ulx nuke, "!nuke" )
nuke:defaultAccess( ULib.ACCESS_SUPERADMIN )
nuke:help( "Nukes zombies without getting points to players, useful for ending rounds" )

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given