Author Topic: Need some help with a ULX LUA command.  (Read 30521 times)

0 Members and 7 Guests are viewing this topic.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Need some help with a ULX LUA command.
« Reply #15 on: June 23, 2011, 06:34:45 PM »
Cool, let me know how it runs.

I was only going to pick it up if you gave up on it. The idea is too good to let it just die, though I'd rather have you be the one to complete and release it seeing as it was your idea.

Oh OK, so I tested it in the server how it is currently and nothing happens, I mean the command does not run and gives no errors.

Edit: I think I know what the problem is...

in places such as...

Code: [Select]
function Spawnzomb( Pos, Ang, pl, pl.zomb )
and

Code: [Select]
function ulx.zombify( calling_ply, target_plys, pl.zomb )
pl.zomb should probably just be "zomb". I am gonna try that and hopefully get some thing from it.
« Last Edit: June 23, 2011, 06:38:33 PM by HeLLFox_15 »
I cry every time I see that I am not a respected member of this community.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Need some help with a ULX LUA command.
« Reply #16 on: June 23, 2011, 07:16:36 PM »
No, pl.zomb is the entity now.. as long as the function identifies pl as the player entity it should see it.


zomb will never equal pl.zomb... if you know how OOP works you will know why.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Need some help with a ULX LUA command.
« Reply #17 on: June 23, 2011, 08:34:38 PM »
Can't speak for other visitors, but MrP, my team mates, and a few other regulars here are more than happy to assist, give credit when credit is due, and like seeing new insight and ideas from others such as yourself, even if learning Glua for the first time (Most of us learn here, even when those such as yourself ask questions about stuff we've seen, there's always something we haven't.) :D
If you take a look at the ULib and ULX change logs, you'll see various honorable mentions of users who have helped us over time, including MrPresident himself.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Need some help with a ULX LUA command.
« Reply #18 on: June 24, 2011, 08:28:47 AM »
I now have an error the error is...

Code: [Select]
[addons\ulx_svn-hellfox_15\lua\ulx\modules\sh\sh_zombify.lua:3] ')' expected near '.'
« Last Edit: June 24, 2011, 08:54:35 AM by HeLLFox_15 »
I cry every time I see that I am not a respected member of this community.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Need some help with a ULX LUA command.
« Reply #19 on: June 24, 2011, 08:56:01 AM »
I now have an error the error is...

Code: [Select]
[addons\ulx_svn-hellfox_15\lua\ulx\modules\sh\sh_zombify.lua:3] ')' expected near '.'

Could you share line three and a few of the surrounding lines? Line 3 on the OP is a blank line.
Experiencing God's grace one day at a time.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Need some help with a ULX LUA command.
« Reply #20 on: June 24, 2011, 09:05:54 AM »
Could you share line three and a few of the surrounding lines? Line 3 on the OP is a blank line.

Well scence I added that comment into the lua... "function Spawnzomb( Pos, Ang, pl, pl.zomb )" is in line 3.

Code: [Select]
-- ULX Zombify for ULX SVN/ULib SVN by HeLLFox_15 with assistance from MrPresident, Megiddo, and JamminR

function Spawnzomb( Pos, Ang, pl, pl.zomb )
R = { "npc_fastzombie", "npc_zombie", "npc_zombie_torso", "npc_zombine", "npc_fastzombie_torso" }

pl.zomb = ents.Create( R[math.random(1,5)] )
pl.zomb:SetAngles( Ang )
pl.zomb:SetPos( Pos )
pl.zomb:Spawn()
pl.zomb:Activate()
timer.Create( "zombRemoveB_"..CurTime(), 120.5, 1, function( pl.zomb, target_plys ) pl.zomb:Remove() end )

end

function ulx.zombify( calling_ply, target_plys, pl.zomb )
for _, pl in ipairs( target_plys, calling_ply ) do
pl:SetMoveType( MOVETYPE_NONE )
pl:EmitSound( "ambient/creatures/town_zombie_call1.wav", 100, 100 )

timer.Create( "zombSpawn_"..CurTime(), 1, 1, Spawnzomb( pl:GetPos(), pl:GetAngles(), pl ) )
pl:StripWeapons()
pl:Spectate( OBS_MODE_CHASE )
pl:SpectateEntity( pl.zomb )

timer.Create( "zombRemoveA_"..CurTime(), 120, 1,
function( target_plys )
pl:UnSpectate()
pl:Freeze( false )
pl:Spawn()
end )

end

ulx.fancyLogAdmin( calling_ply, "#A zombified #T for a #s amount of time", command, target_plys )
end

local zombify = ulx.command( "Fun", "ulx zombify", ulx.zombify, "!zombify" )
zombify:addParam{ type=ULib.cmds.PlayerArg }
zombify:defaultAccess( ULib.ACCESS_SUPERADMIN )
zombify:help( "Turn a player into a zombie. Note: Do not use this on multiple players." )
I cry every time I see that I am not a respected member of this community.

An Error Has Occurred!

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