Ok I will change it to OBS_MODE_IN_EYE. Also I noticed that ulx.fancyLogAdmin is not displaying a message after I use the command.
-- ULX Zombify for ULX SVN/ULib SVN by HeLLFox_15 with assistance from MrPresident, Megiddo, and JamminR
-- Organized by MrPresident
function Spawnzomb( pl, pos, ang, number )
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()
pl.zomb:SetNPCState(3)
pl.zomb:CallOnRemove( DespawnZomb, pl, pl.zomb)
pl:Spectate( OBS_MODE_IN_EYE )
pl:SpectateEntity( pl.zomb )
if( pl.zomb:Alive() ) then else DespawnZomb( pl, pl.zomb ) end
timer.Create( "zombRemove_"..CurTime(), number, 1, DespawnZomb, pl, pl.zomb )
end
function DespawnZomb( pl, zomb )
if zomb then
zomb:Remove()
end
pl:UnSpectate()
pl:Freeze( false )
pl:Spawn()
end
function ulx.zombify( calling_ply, target_ply, number )
local pl = target_ply
local pos = pl:GetPos()
local ang = pl:GetAngles()
local Effect = EffectData()
Effect:SetOrigin(pos)
Effect:SetStart(pos)
Effect:SetMagnitude(512)
Effect:SetScale(128)
util.Effect("cball_explode", Effect)
pl:EmitSound( "ambient/creatures/town_zombie_call1.wav", 100, 100 )
pl:StripWeapons()
Spawnzomb( pl, pos, ang, own )
ulx.fancyLogAdmin( calling_ply, "#A zombified #T for #s seconds", target_ply, number )
end
local zombify = ulx.number( "Fun", "ulx zombify", ulx.zombify, "!zombify" )
zombify:addParam{ type=ULib.cmds.PlayerArg }
zombify:addParam{ type=ULib.cmds.NumArg, hint="number", min=10, max=60, default=10, ULib.cmds.optional }
zombify:defaultAccess( ULib.ACCESS_SUPERADMIN )
zombify:help( "Turn a single player into a zombie." )
Edit: As you may have seen in one of my other posts, my command gets no. Errors but that was B4 this update. So after I test this I will get back to you.
Edit Read: Also what do you mean by "looks like 'own' should be 'command'", do you mean that if I change the hint to 'own' but not the variable that's how it would run?