Hey guys, I'm trying to create a ULX Redeem script for Zombie Survival.
The code bellow is the redeem script from ZS (AFAIK)
function GM:PlayerRedeemed(pl, silent, noequip)
if not silent then
umsg.Start("PlayerRedeemed")
umsg.Entity(pl)
umsg.End()
end
pl:RemoveStatus("overridemodel", false, true)
pl:ChangeTeam(TEAM_HUMAN)
pl:DoHulls()
if not noequip then pl.m_PreRedeem = true end
pl:UnSpectateAndSpawn()
pl.m_PreRedeem = nil
local frags = pl:Frags()
if frags < 0 then
pl:SetFrags(frags * 5)
else
pl:SetFrags(0)
end
pl:SetDeaths(0)
pl.DeathClass = nil
pl:SetZombieClass(self.DefaultZombieClass)
pl.SpawnedTime = CurTime()
end
Concommand.Add( "Redeem", PlayerRedeemed ) ---- I added this!
Now this is the ULX addon i tried to use
function ulx.slay( calling_ply, target_plys )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
else
v:Redeem() -------------------------------- Problem is here!
table.insert( affected_plys, v )
end
end
ulx.fancyLogAdmin( calling_ply, "#A redeemed #T", affected_plys )
end
local redeem = ulx.command( CATEGORY_NAME, "ulx redeem", redeem, "!redeem" )
slay:addParam{ type=ULib.cmds.PlayersArg }
slay:defaultAccess( ULib.ACCESS_ADMIN )
slay:help( "Redeem target(s)." )
Obviously i need to give arguments as to what player i want to redeem but how do i go about doing so?