#
Creating a command
#
Why using our command system?
- You'll be able to create new commands without coding experience.
- Fast and efficient creation of basic commands.
- No more boilerplate code for the same tasks, we handle everything.
Our command system does a good job for simple commands, simply route the commands and run a few checks.
If you want something really specific you should probably code something of your own.
Try it out by executing /commandcreator
#
What placeholders can I use by default?
You have three types of placeholders that we provide:
- Framework based (a valid framework is required)
- Default placeholders (command data, cfx natives...)
- Check placeholders (these are parsed in the checking step)
#
Built-in placeholders
Coding skills required
Please note that you must have so basic knowledge on how lua syntax work, functions and variables among other things.
If you don't manage to understand how this works, use the built-in command tool or hire a developer.
#
Creating a custom placeholder
You must head to client/custom/placeholder.lua and you'll find the following:
Client.Custom["Placeholder"]["ServerId"] = function(placeholder, orTable, args)
return tostring(GetPlayerServerId(PlayerId()))
end
Client.Custom["Placeholder"]["CfxName"] = function(placeholder, orTable, args)
return GetPlayerName(PlayerId())
end
-- ... add as many as you want
#
Creating a placeholder
In order to create a placeholder we'll simply copy and paste one of the above placeholders and rename the second table field DO NOT RENAME "Placeholder".
-- @param placeholder string
-- @param orTable table
-- @param args table
-- @return string
Client.Custom["Placeholder"]["GetHealth"] = function(placeholder, orTable, args) -- See, we only rename the second field.
return GetEntityHealth(PlayerId())
end
-- @param placeholder string
-- @param orTable table
-- @param args table
-- @return string
Client.Custom["Placeholder"]["GetRank"] = function(placeholder, orTable, args) -- See, we only rename the second field.
return exports.myCoolResource:GetPlayerRank()
end