• Print

Author Topic: admin sweps = ulx_concommand  (Read 10954 times)

0 Members and 1 Guest are viewing this topic.

Offline Locou

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • Loctum.de
admin sweps = ulx_concommand
« on: October 04, 2006, 01:08:03 pm »
I used the Tutorial with ULX_CONCOMMAND but it still not work.

I've open the swep_menu.lua and relpaced
Code: [Select]
CONCOMMAND( "SWEPSpawn", cc_SpawnSWEP, "Spawn SWEP weapon; Syntax: <filename>");with
Code: [Select]
ULX_CONCOMMAND( "SWEPSpawn", cc_SpawnSWEP, "Spawn SWEP weapon; Syntax: <filename>", ACCESS_IMMUNITY);but if I try to Spawn a SWEP in SP or MP it don't work.
Code: [Select]
unknown command: SWEPSpawn
Somthing i did wrong? Help? :-\
« Last Edit: October 07, 2006, 01:04:56 am by Locou »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: admni sweps = ulx_concommand
« Reply #1 on: October 04, 2006, 02:46:53 pm »
You want ULib.CONCOMMAND now... that reminds me, I forgot to put ULX_CONCOMMAND in compat.lua. Silly me.

What tutorial did you get this information from? Can you link me to it so I can change it?
Experiencing God's grace one day at a time.

Offline Locou

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • Loctum.de
Re: admni sweps = ulx_concommand
« Reply #2 on: October 05, 2006, 06:47:40 am »
I've used this one:
http://forums.facepunchstudios.com/showthread.php?t=121765

Edit:
But now i have the same problem as above.
Code: [Select]
Unknown command: SWEPSpawn
Code: [Select]
ULib.CONCOMMAND( "SWEPSpawn", cc_SpawnSWEP, "Spawn SWEP weapon; Syntax: <filename>", ACCESS_IMMUNITY);
« Last Edit: October 05, 2006, 12:37:30 pm by Locou »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: admni sweps = ulx_concommand
« Reply #3 on: October 05, 2006, 01:27:49 pm »
Try
"ulx SWEPSpawn" (no quotes)??
I think that is what ULib.CONCOMMAND does.

Megiddo will correct me soon if I'm wrong.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: admni sweps = ulx_concommand
« Reply #4 on: October 05, 2006, 02:27:20 pm »
Can't use "ulx <...>", as it's a subcommand. Better off using commands without spaces for small projects.

Also, you need the load string for ULib at the top of your file. It has been included below for you.
Code: Lua
  1. assert( _file.Exists( "lua/ULib/init.lua" ), "<Insert script name> needs ULib to run!" )
  2. _OpenScript( "ULib/init.lua" )
  3. assert( ULib.VERSION >= 1, "<Insert script name> requires ULib version 1 or higher to run!" ) -- Insert what version you want in place of 1

If that doesn't work, be sure to check for errors in the console while loading.
Experiencing God's grace one day at a time.

Offline Locou

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • Loctum.de
Re: admni sweps = ulx_concommand
« Reply #5 on: October 06, 2006, 06:40:29 am »
It works now!
If i try to spawn a SWEP ULib say:
"You do not have access to this command, Locou."


lua/ULib/user.ini
// Examples of admin accounts:
// "STEAM_0:1:959562" "pepper" "abcdefghijklmnopqrstuv" "c"
"STEAM_0:1:959562" "pepper" "abcdefghijklmnopqrstuv" "c"

I've also tryed "Locou" "pepper" "abcdefghijklmnopqrstuv" "a"


] _pw pepper
[UCL] You are already authenticated.
« Last Edit: October 06, 2006, 06:44:32 am by Locou »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: admni sweps = ulx_concommand
« Reply #6 on: October 06, 2006, 07:09:31 am »
Are there errors on startup, and what line are you using for concommand?
Experiencing God's grace one day at a time.

Offline Locou

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • Loctum.de
Re: admni sweps = ulx_concommand
« Reply #7 on: October 06, 2006, 07:24:46 am »
Full swep_menu.lua code:
Code: [Select]
-- SWEP menu, Garry Newman 2005
--
-- To disable this menu just change Enabled to false below.
--
--


assert( _file.Exists( "lua/ULib/init.lua" ), "<Insert script name> needs ULib to run!" )
_OpenScript( "ULib/init.lua" )
assert( ULib.VERSION >= 1, "<Insert script name> requires ULib version 1 or higher to run!" ) -- Insert what version you want in place of 1

g_SWEPMenu = {}
g_SWEPMenu.Enabled = true
g_SWEPMenu.MenuTitle = "SWEP Weapons Admin"
g_SWEPMenu.SpawnRate = 3.0
g_SWEPMenu.Players = {}
g_SWEPMenu.ShowCategories = true
g_SWEPMenu.ExcludeFolders = { ".",
"..",
"football",
"build",
"hideandseek" }

if (g_SWEPMenu.Enabled) then

g_SWEPs = {}

function AddSWEPToMenu( category, name, filepath )

-- Strip some crap from the weapon names..
--name = string.gsub(name, "weapon_", "")
--name = string.gsub(name, "tpc_", "")
name = string.gsub(name, ".lua", "")

filepath = string.gsub(filepath, "lua/weapons/", "")
filepath = string.gsub(filepath, ".lua", "")

local tWeapon = {}
tWeapon.category = category;
tWeapon.name = name;
tWeapon.filename = filepath;

table.insert( g_SWEPs, tWeapon );

end


function ProcessSWEPFolder( k, name )

for i=1, table.getn(g_SWEPMenu.ExcludeFolders) do
if (g_SWEPMenu.ExcludeFolders[i] == name) then
return;
end
end

local FileName = "lua/weapons/" .. name ;
if (_file.IsDir(FileName) == false) then return end;

local tFiles = _file.Find( FileName .. "/*.lua" );

for i=1, table.getn(tFiles) do

AddSWEPToMenu( name, tFiles[i], FileName .."/".. tFiles[i] );

end

end


function PopulateSWEPList()

local tFiles = _file.Find( "lua/weapons/*" );
table.foreach( tFiles, ProcessSWEPFolder );

end


function PlayerSendSWEPMenu( iPlayer )

if (iPlayer==0) then return end;
if (_GetRule( "AllowObjectSpawning" )==false) then return; end;

local LastCat = ""

-- Set up this player's settings
g_SWEPMenu.Players[iPlayer] = {}
g_SWEPMenu.Players[iPlayer].NextSpawn = 0

for i=1, table.getn(g_SWEPs) do

if ( LastCat ~= g_SWEPs[i].category and g_SWEPMenu.ShowCategories ) then
_spawnmenu.AddItem( iPlayer, g_SWEPMenu.MenuTitle, "@" .. g_SWEPs[i].category, "" );
LastCat = g_SWEPs[i].category
end

_spawnmenu.AddItem( iPlayer, g_SWEPMenu.MenuTitle, "+" .. g_SWEPs[i].name, "SWEPSpawn " .. g_SWEPs[i].filename );

end

end


function cc_SpawnSWEP( iPlayer, strFilename )

-- Time between spawns.
if ( g_SWEPMenu.Players[iPlayer].NextSpawn > _CurTime() and _MaxPlayers() > 1 ) then
return;
end

if ( _GetRule( "AllowObjectSpawning" )==false ) then return end;
if ( _file.Exists( "lua/weapons/" .. strFilename .. ".lua" ) == false ) then return end;
if ( not _PlayerInfo( iPlayer, "alive") ) then return end;

-- Make sure this is in our spawnables list
local bFound = false;
for i=1, table.getn(g_SWEPs) do
if ( g_SWEPs[i].filename == strFilename ) then bFound = true; end;
end
if ( not bFound ) then return end;


PlayerLookTrace( iPlayer, 200 );
if ( _TraceHit() == false ) then return end;

local vSpawnPos = _TraceEndPos();
local vNormal = _TraceGetSurfaceNormal();

vSpawnPos = vecAdd( vSpawnPos, vecMul( vNormal, 50 ) )

local iEnt = _EntCreate( "weapon_swep" )
_EntSetPos( iEnt, vSpawnPos )
_EntSetKeyValue( iEnt, "Script", strFilename )
_EntSpawn( iEnt )
_util.DropToFloor( iEnt )


g_SWEPMenu.Players[iPlayer].NextSpawn = _CurTime() + g_SWEPMenu.SpawnRate;

end


PopulateSWEPList();
HookEvent( "eventPlayerInitialSpawn", PlayerSendSWEPMenu );
ULib.CONCOMMAND( "SWEPSpawn", cc_SpawnSWEP, "Spawn SWEP weapon; Syntax: <filename>", ACCESS_IMMUNITY);

end

full startup in console:
Code: [Select]
Game.dll loaded for "GMod 9.0.4"
GMod Folder: c:\programme\valve\steam\steamapps\sourcemods\gmod9
Processing Lua config file..
Finished Lua Config.
Creating Lua instance..
Lua Script: init/init.lua
Lua Script: init/BarrierInit.lua
Lua Script: init/EXTREME functions.lua

Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/Antlion_gib_medium_2.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/Antlion_gib_small_3.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/Antlion_gib_small_1.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/HGIBS.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/HGIBS_rib.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/HGIBS_scapula.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/Gibs/HGIBS_spine.mdl' overflow, too many models


Host_Error: CVEngineServer::PrecacheModel: 'models/props/cs_italy/orangegib3.mdl' overflow, too many models

Lua Script: init/e_commands.lua
Lua Script: init/makecode.lua
Line 1: unexpected symbol near '/'
LUA: Errors when running script 'init/makecode.lua'
Lua Script: init/propprotector.lua
Lua Script: init/racehook3.lua
Line 1: unexpected symbol near '/'
LUA: Errors when running script 'init/racehook3.lua'
Lua Script: init/ropegun.lua
Lua Script: init/swep_menu.lua
///////////////////////////////
//      Ulysses Library      //
///////////////////////////////
// Loading...                //
//  defines.lua              //
//  misc.lua                 //
//  util.lua                 //
//  tables.lua               //
//  database.lua             //
//  ai.lua                   //
//  color.lua                //
//  concommand.lua           //
//  download.lua             //
//  entity.lua               //
//  list.lua                 //
//  menu.lua                 //
//  messages.lua             //
//  misc.lua                 //
//  phys.lua                 //
//  player.lua               //
//  say.lua                  //
//  ucl.lua                  //
//  ucl_public.lua           //
//  vector.lua               //
//  compat.lua               //
// Load Complete!            //
///////////////////////////////
Lua Script: init/ticker.lua
Lua Script: init/ulx_init.lua
///////////////////////////////
//            ULX            //
///////////////////////////////
// Loading...                //
//  base.lua                 //
//  util.lua                 //
//  fun.lua                  //
//  menus.lua                //
//  end.lua                  //
// Load Complete!            //
///////////////////////////////
Lua Script: init/vmfloader.lua
Line 21: attempt to call field 'AddAddon' (a nil value)
LUA: Errors when running script 'vmfloader/beta2/addons/propprotection.lua'
Lua Script: init/zzpropprotector.lua
Lua created.
maxplayers set to 1
[ECS] - EThink function : 028E9D14. Frequency : 0.5
[ECS] - EThink function : 028E8E74. Frequency : 0.5
[ECS] - eSwep : entmover ( e_commands/sweps/weapon_entmover.lua )
[ECS] - EThink function : 028EA878. Frequency : 0.25
[ECS] - EThink function : 028EAD64. Frequency : 0.25
[ECS] - EThink function : 028EADD0. Frequency : 0.25
[ECS] - eSwep : selectgun ( e_commands/sweps/weapon_select.lua )
[ECS] - EThink function : 028EB250. Frequency : 0.5
[ECS] - EThink function : 028EB97C. Frequency : 1
[ECS] - EThink function : 028EB910. Frequency : 0.75
Heap: 256.00 Mb
Parsed 23 text messages
execing config.cfg
Can't use cheat cvar cam_command in multiplayer, unless the server has sv_cheats set to 1.
1 CPU, Frequency: 2.2 Ghz,  Features: AuthenticAMD SSE MMX 3DNow RDTSC CMOV FCMOV
GetAllManifestFiles:  Unable to load maplist.txt
execing valve.rc
execing autoexec.cfg
Banning all bitches...
Usage:  addip < minutes > < ipaddress >
Use 0 minutes for permanent
Usage:  addip < minutes > < ipaddress >
Use 0 minutes for permanent
...Done
Banning all imposters...
...Done
couldn't exec HuntsMod/picture
CModelLoader::Map_IsValid:  No such map 'none'
map load failed: none not found or invalid
GMod Folder: c:\programme\valve\steam\steamapps\sourcemods\gmod9
Loading map 'gm_construct'..
maxplayers set to 1
execing game.cfg
Spawn Server gm_construct
Begin loading faces (loads materials)
End loading faces (loads materials)
GMod Folder: c:\programme\valve\steam\steamapps\sourcemods\gmod9
Creating Lua instance..
Lua Script: init/init.lua
Lua Script: init/BarrierInit.lua
Lua Script: init/EXTREME functions.lua
Late precache of models/Gibs/Antlion_gib_medium_2.mdl
Late precache of models/Gibs/Antlion_gib_small_3.mdl
Late precache of models/Gibs/Antlion_gib_small_1.mdl
Late precache of models/Gibs/HGIBS.mdl
Late precache of models/Gibs/HGIBS_rib.mdl
Late precache of models/Gibs/HGIBS_scapula.mdl
Late precache of models/Gibs/HGIBS_spine.mdl
Late precache of models/props/cs_italy/orangegib3.mdl
Lua Script: init/e_commands.lua
Lua Script: init/makecode.lua
Lua Error: Line 1: unexpected symbol near '/'
LUA: Errors when running script 'init/makecode.lua'
Lua Script: init/propprotector.lua
Lua Script: init/racehook3.lua
Lua Error: Line 1: unexpected symbol near '/'
LUA: Errors when running script 'init/racehook3.lua'
Lua Script: init/ropegun.lua
Lua Script: init/swep_menu.lua
///////////////////////////////
//      Ulysses Library      //
///////////////////////////////
// Loading...                //
//  defines.lua              //
//  misc.lua                 //
//  util.lua                 //
//  tables.lua               //
//  database.lua             //
//  ai.lua                   //
//  color.lua                //
//  concommand.lua           //
//  download.lua             //
//  entity.lua               //
//  list.lua                 //
//  menu.lua                 //
//  messages.lua             //
//  misc.lua                 //
//  phys.lua                 //
//  player.lua               //
//  say.lua                  //
//  ucl.lua                  //
//  ucl_public.lua           //
//  vector.lua               //
//  compat.lua               //
// Load Complete!            //
///////////////////////////////
Lua Script: init/ticker.lua
Lua Script: init/ulx_init.lua
///////////////////////////////
//            ULX            //
///////////////////////////////
// Loading...                //
//  base.lua                 //
//  util.lua                 //
//  fun.lua                  //
//  menus.lua                //
//  end.lua                  //
// Load Complete!            //
///////////////////////////////
Lua Script: init/vmfloader.lua
Lua Error: Line 21: attempt to call field 'AddAddon' (a nil value)
LUA: Errors when running script 'vmfloader/beta2/addons/propprotection.lua'
Lua Script: init/zzpropprotector.lua
Lua created.
[ECS] - EThink function : 028F1868. Frequency : 0.5
[ECS] - EThink function : 028EEBF8. Frequency : 0.5
[ECS] - eSwep : entmover ( e_commands/sweps/weapon_entmover.lua )
[ECS] - EThink function : 028F0CE0. Frequency : 0.25
[ECS] - EThink function : 028EA02C. Frequency : 0.25
[ECS] - EThink function : 028E9480. Frequency : 0.25
[ECS] - eSwep : selectgun ( e_commands/sweps/weapon_select.lua )
[ECS] - EThink function : 028EDA1C. Frequency : 0.5
[ECS] - EThink function : 028E5C1C. Frequency : 1
[ECS] - EThink function : 028E59DC. Frequency : 0.75
execing skill.cfg
Unknown command "sk_player_head"
Unknown command "sk_player_chest"
Unknown command "sk_player_stomach"
Unknown command "sk_player_arm"
Unknown command "sk_player_leg"
Executing listen server config file
Setting MPRules from console variables..
The Navigation Mesh was built using a different version of this map.
Game started
couldn't exec listenserver.cfg
Initializing renderer...
Populating Spawn List............................. Done!
[PROP] Lan/Listenserver copatibilitymode activated
[PROP] Locou (Locou) initialized
[LUA] Error calling 'DoEventHook' : 'Line 16: attempt to concatenate local 'simpleName' (a nil value)'
[LUA] Error calling 'DoEventHook' : 'Line 44: attempt to call field 'func' (a nil value)'
Late precache of models/player/gman_high.mdl
      [PROP] Locou (Locou) initialized
Locou has connected
[UCL] Access set.
Welcome to GMod 9.0.4! We're playing gm_construct.
Late precache of models/props_junk/sawblade001a.mdl

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: admni sweps = ulx_concommand
« Reply #8 on: October 06, 2006, 10:33:45 am »
You have a lua virus which blocks SWEP spawning. Your virus is called 'racehook3.lua'. You can see it loaded in your load log above. For more information on this virus visit http://forums.facepunchstudios.com/showthread.php?t=169052
Experiencing God's grace one day at a time.

Offline Locou

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • Loctum.de
Re: admni sweps = ulx_concommand
« Reply #9 on: October 06, 2006, 04:29:40 pm »
Ok it works now! (reinstall gmod)
At first i had the same problem as above! "You do not have access to this command, Locou."
I tryed at first ACCESS_ALL. Works!
And then i tryed ACCESS_RESERVATION. And it works too!

Somthing with ACCESS_IMMUNITY isn't right, but i'm so happy! It works now!!
Thanks a lot!  ;D

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: admni sweps = ulx_concommand
« Reply #10 on: October 06, 2006, 05:41:23 pm »
If you were hosting a listen server you don't get immunity by default... guess I should put in an override for that ;)
Experiencing God's grace one day at a time.

  • Print