General > Developers Corner

default a player themselves

(1/1)

gaylord69?:
how i can make default param for custom command a player themselves?

Timmy:
Make the PlayerArg optional and it will default to self.


--- Code: ---cmd:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
--- End code ---

Have a look at the source of "ulx teleport" for a real world example.

See the ULib documentation for more details.

Navigation

[0] Message Index

Go to full version