General > Developers Corner
TTT Module not working
TheSpy7:
Hi all. I have the following files in my /modules/sh/ folder.
Traitor.lua:
--- Code: ---local CATEGORY_NAME = "Traitor"
function ulx.Traitor( ply, targs )
for _,v in pairs(targs) do
v:SetTeam( TEAM_TERROR )
v:Spawn()
v:SetRole(ROLE_TRAITOR)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A has made #T a Traitor!", targs )
end
local Traitor = ulx.command( "Traitor", "ulx Traitor", ulx.Traitor, "!Traitor" )
Traitor:addParam{ type=ULib.cmds.PlayersArg }
Traitor:defaultAccess( ULib.ACCESS_SUPERADMIN )
Traitor:help( "Make target a Traitor." )
--- End code ---
Innocent.lua:
--- Code: ---local CATEGORY_NAME = "Innocent"
function ulx.Innocent( ply, targs )
for _,v in pairs(targs) do
v:SetTeam( TEAM_TERROR )
v:Spawn()
v:SetRole(ROLE_INNOCENT)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A has made #T an Innocent!", targs )
end
local Innocent = ulx.command( "Innocent", "ulx Innocent", ulx.Innocent, "!Innocent" )
Innocent:addParam{ type=ULib.cmds.PlayersArg }
Innocent:defaultAccess( ULib.ACCESS_SUPERADMIN )
Innocent:help( "Make target a Innocent." )
--- End code ---
Detective.lua:
--- Code: ---local CATEGORY_NAME = "Detective"
function ulx.Detective( ply, targs )
for _,v in pairs(targs) do
v:SetTeam( TEAM_TERROR )
v:Spawn()
v:SetRole(ROLE_DETECTIVE)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A has made #T a Detective!", targs )
end
local Detective = ulx.command( "Detective", "ulx Detective", ulx.Detective, "!Detective" )
Detective:addParam{ type=ULib.cmds.PlayersArg }
Detective:defaultAccess( ULib.ACCESS_SUPERADMIN )
Detective:help( "Make target a Detective." )
--- End code ---
For some reason none of these files work while another is placed in the folder. Why is this, and how do I fix it?
nathan736:
any errors ? and you should use a combo command like !role targs,role changes target players to t/i/d
TheSpy7:
--- Quote from: nathan736 on March 19, 2013, 10:55:14 AM ---any errors ? and you should use a combo command like !role targs,role changes target players to t/i/d
--- End quote ---
There are errors in the console for my server. When I get home I will take screenshots and post.
Thanks,
TheSpy7
JamminR:
Text preferred. Copy/paste it instead of the images.
TheSpy7:
--- Quote from: JamminR on March 19, 2013, 01:49:47 PM ---Text preferred. Copy/paste it instead of the images.
--- End quote ---
Got it.
Server console is returning with this:
--- Code: ---[ERROR] addons/ulib/lua/ulib/shared/commands.lua:1296: Invalid command!
1. __fn - [C]:-1
2. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
3. Run - lua/includes/modules/concommand.lua:69
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
5. unknown - lua/includes/modules/concommand.lua:69
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version