ULX

Author Topic: default a player themselves  (Read 309 times)

0 Members and 1 Guest are viewing this topic.

Offline gaylord69?

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
default a player themselves
« on: May 12, 2020, 11:56:29 PM »
how i can make default param for custom command a player themselves?

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 251
  • Karma: 167
  • Code monkey
Re: default a player themselves
« Reply #1 on: May 13, 2020, 03:57:36 AM »
Make the PlayerArg optional and it will default to self.

Code: [Select]
cmd:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
Have a look at the source of "ulx teleport" for a real world example.

See the ULib documentation for more details.
« Last Edit: May 13, 2020, 04:46:16 AM by Timmy »