Ulysses
General => Developers Corner => Topic started by: awesomenessispure on September 24, 2014, 02:45:34 PM
-
I have the spectator deathmatch addon in ttt. I want admins to be able to force people. I tried this code it doesn't work how can I fix it.
local CATEGORY_NAME = "Deathmatch"
function ulx.deathmatch( calling_ply, target_ply, command )
if not target_ply:Alive() then
v:ConCommand("say !dm")
ulx.fancyLogAdmin( calling_ply, true, "#A Joined Deathmatch", target_ply )
end
end
local deathmatch = ulx.command( CATEGORY_NAME, "ulx deathmatch", ulx.deathmatch, "!ulxdm", true )
deathmatch:addParam{ type=ULib.cmds.PlayerArg }
deathmatch:defaultAccess( ULib.ACCESS_ADMIN )
deathmatch:help( "Makes player join deathmatch" )
-
if not target_ply:Alive() then
v:ConCommand("say !dm")
Look at your error in console when you try to run that.
Variable "v" is null.
You don't have it defined (hint - you need to use another variable you are already using)
-
Can you tell me what to fix exactly? I am a noob at ULX.
-
That's 100% pure lua issue..nothing to do with ulx.
v: needs to be target_ply: because you pass variables calling_ply and target_ply to the function, but never define what v is.