Ulysses

General => Developers Corner => Topic started by: gaylord69? on May 12, 2020, 11:56:29 PM

Title: default a player themselves
Post by: gaylord69? on May 12, 2020, 11:56:29 PM
how i can make default param for custom command a player themselves?
Title: Re: default a player themselves
Post by: Timmy 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 (https://ulyssesmod.net/docs/files/lua/ulib/shared/commands-lua.html#cmds.PlayerArg) for more details.