ULX

Author Topic: ULX preset ent commands  (Read 2590 times)

0 Members and 1 Guest are viewing this topic.

Offline thymason122

  • Newbie
  • *
  • Posts: 3
  • Karma: -3
ULX preset ent commands
« on: May 22, 2016, 03:14:51 PM »
My ULib/ULX versions:
ULib v2.60d (02/17/16)
ULX v3.70d (03/20/16)

GM: Murder (But its a global question)

Right now I'm trying to make a preset entity command (or "ulx ent") so people can just type the command in chat or press a button in the menu.
I tried taking a look at the rcon file (where the ent command is) and I can't really understand on how to make it preset.

So basically this custom command would be like the ent command, with the class name as:
prop_physics
and the params being:
model:models/props_junk/garbage_glassbottle001a.mdl

This would spawn a bottle. I don't want the fillout params because it would allow the rank to abuse the feature.
If you have any suggestions, lemme know! Thanks!

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Re: ULX preset ent commands
« Reply #1 on: May 22, 2016, 05:52:02 PM »
Why not create a wrapper ulx command that just calls ulx.ent, passing in the appropriate arguments?

Offline thymason122

  • Newbie
  • *
  • Posts: 3
  • Karma: -3
Re: ULX preset ent commands
« Reply #2 on: May 22, 2016, 05:53:40 PM »
How would I do that? I'm more of a newb to custom ULX commands.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX preset ent commands
« Reply #3 on: May 22, 2016, 09:48:19 PM »
This isn't Facepunch. You're not getting lost in the speed of topics here.
Bump one more time and I'm banning you a month.
We understand you want help.
For the time it took you to bump twice, you could have looked through ULX code in Github to see how commands are done, or found any number of tutorials here on our site.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline thymason122

  • Newbie
  • *
  • Posts: 3
  • Karma: -3
Re: ULX preset ent commands
« Reply #4 on: May 22, 2016, 10:12:37 PM »
I understand that. I already made a facepunch thread. They told me to come here, hence why my account is so new. And my question was just asking on how to make a wrapper command and what it is. Sorry if it seems like I have a tude, but I really would like this done. I've been waiting for an answer for 8 hours (From the start of my FP thread.)

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Re: ULX preset ent commands
« Reply #5 on: May 25, 2016, 08:03:42 PM »
I'm just freeflowing here, so I prob did something stupid, but something like this..

Code: [Select]
function ulx.ent_bottle( calling_ply )
ulx.ent(calling_ply, "prop_physics", "model:models/props_junk/garbage_glassbottle001a.mdl")
end
local ent_bottle = ulx.command( "A_CATEGORY_NAME", "ulx ent_bottle", ulx.ent_bottle)
ent_bottle:defaultAccess( ULib.ACCESS_SUPERADMIN )
ent_bottle:help( "Spawn a bottle" )