Welcome to the FiveM-Core,
This is a basic core mode for easy development and management of a normal server. Access to various commands and easy guides on how to make usage of them. Currently in the works.
Features of FiveM_Core
Easy creation of commands and events for easy development.
Easy use of commands and events.
A group system based on a password.
Chat Proximately.
Modular Assets
Accessible scripts converted or made for FiveM Core will be directly linkable from this thread Into Github. Please Make sure you read the installation manual and update your main.lua file.
- Adverts - In Progress
- Welcome Message - In Progress
- SMS System - In Progress
Support Tutorial (Basic Text Command)
If you’re looking to create a basic text command either for the client or the player you can follow this easy tutorial. Firstly, create a Lua file preferably named after the command in fivem_core/cmds
and add the command to your main.lua following the code below.
Cmd’s Accessible by default:
TriggerCmd = Client
TriggerAdminCmd = Admin
TriggerCopCmd = Cop
elseif cmd == "/commandname" then
TriggerCmd("commandname", p, args)
next, add your command file to fivem_core/ _resouces
as server script and proceed to the commandname.Lua
file with an editor program.
Creation of the Script
In this tutorial we will create a 911 message displayed if a user(s) inputs /911 in the chat system.
-----------------
--FIVEM Script --
-----------------
RegisterServerEvent("CGC:command")
AddEventHandler("CGC:command", function(p, args)
if args[1] ~= nil then
reason = joinArgs(args)
sendMessage(-1, prefix_info .. GetPlayerName(p) .. orange .. "" .. reason)
else
sendMessage(source, prefix_error .. "Please state what u want")
end
end)
Explanation:
This essentially means that if /command is inputted into the chat system it has to have a one argument. If the user(s) inputs /command without a second message it will show the error message however, if the user(s) does /command test it will show [INFO] Playername test
.
Types of Messages:
if you want to create a client message use source,
. If you want to have a messaged displayed to everyone use -1,
.
Custom Message:
You can also customize the script to input a set message. this can be done by doing " message " within the message you want it to display in . For this example to display Has Called 911 for:
.
-----------------
--FIVEM Script --
-----------------
RegisterServerEvent("CGC:911")
AddEventHandler("CGC:911", function(p, args)
if args[1] ~= nil then
reason = joinArgs(args)
sendMessage(-1, prefix_info .. GetPlayerName(p) .. orange .. "has called 9111 for:" .. reason)
else
sendMessage(source, prefix_error .. "Please state reason.")
end
end)
Colour Formatting
Below is a list of colours used by FiveM.
^1 = Red
^2 = Green
^3 = Orange
^4 = Blue
^5 = Light Blue
^6 = Purple
^7 = White
~r~ = Red
~b~ = Blue
~g~ = Green
~y~ = Yellow
~p~ = Purple
~c~ = Grey
~m~ = Dark Grey
~u~ = Black
~o~ = Orange
Special:
~n~ = New line
~s~ = Reset Color
~h~ = Bold text
For notification:
∑ = Rockstar Icon
÷ = Rockstar Icon
¦ = Rockstar Verified Icon
Download FiveM_Core
Link to access FiveM_Core currently hidden.
V0.1 FIVEM_Core