Installation
Last updated
Last updated
Dependencies: It is important to use the dependencies that are indicated in this step, do not use others, otherwise you will receive critical errors
It is important to put the resources in the correct order, oxmysql should be started before es_extended followed by ox_lib (should be on top of your starting scripts)
In order for the resource to start correctly and not receive any errors, we must start the resources in the following order
ensure oxmysql
ensure ox_lib
You will need to insert the database that's included into the script and it's called into the
folder: deluxe-matchmaking.sql
In order to do that you will just need to run this sql in your db
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `deluxe_deathmatch` (
`id` int(11) NOT NULL,
`identifier` varchar(46) DEFAULT NULL,
`steamname` varchar(46) DEFAULT NULL,
`wins` int(11) NOT NULL,
`kills` int(11) NOT NULL,
`deaths` int(11) NOT NULL,
`timeplayed` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `deluxe_deathmatch`
ADD PRIMARY KEY (`id`);
ALTER TABLE `deluxe_deathmatch`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
You can fully configure the script based on what your server needs. Here you can find a detailed explaination about all the possible configuration that you can use.
```lua
--[[
______________________________________
________| Deluxe DeathMatch |_______
\ | deluxedevelopment.tebex.io | /
\ | | /
/ |______________________________________| \
/__________) (_________\
Discord Support: https://discord.gg/pqXAbDBmVM
Before you go ahead make sure you have downloaded and installed these dependency
or you might have issues running this script.
1] OXMySQL: https://github.com/overextended/oxmysql/releases
2] OXLib : https://github.com/overextended/ox_lib/releases
]]
```lua
Config = {}
Config.ESX = 'new' -- If you use esx above 1.8 keep new, otherwise type: old
Config.DB = 'oxmysql' -- Only supports oxmysql. You must have it as dependency: https://github.com/overextended/oxmysql/releases
Config.EnableBlips = true -- If you want to enable blips (Blips are configurable in the Config.zones)
Config.LeaderboardCommand = 'openleaderboard' -- Set here the command to open the leaderboard
Config.EnableGameCommand = true -- Allows player to open the deathmatch lobby menu through a command
Config.CommandName = 'openlobby' -- Change to whatever command you want to set (with this command people will be able to open the Lobby UI). It will work only if Config.EnableCommand is set to true.
Config.InventoryType = 'ox' -- Available esx, ox
Config.NotificationType = 'ox' -- Available esx, ox , okok , custom (If you set custom check below the function SetCustomNotification)
Config.OxAlignNotifications = 'center-left' -- Available: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left' [You must have Config.Notificationtype = 'ox']
Config.ReviveServerTriggerEvent = 'default' -- If you have issues with the revive of the player after he dies, replace with your own TriggerEvent to revive your players [You might have problems if you use badly coded built in death systems.]'
Config.EventHandlerDisconnect = 'playerDropped' -- If you didn't change your ESX framework AddEventHandler to detect disconnections/crashes, don't change this.
Config.Weapons =
{
weapon = 'weapon_pistol', -- Weapon to give | All available weapons: https://wiki.rage.mp/index.php?title=Weapons
ammo_count = 100 -- Quantity of ammo to give
}
Config.MapName = 'DeluxeArena' -- Put here your map name (it will show in the lobby menu)
Config.LobbyWaitTime = 7 -- Put here the time before the game will start (will show in lobby menu)
Config.MinimumPlayersToStart = 2 -- Change here the minimum amount of players for the game to start
-- Marker settings:
Config.KeyOpenUIMenu = 38 -- open the menu with 'E' (it will open the menu when you are at the arena zone to open the lobby menu)
-- Marker Interaction Settings
Config.InteractRange = 2.0 -- You can increase/decrease the distance from where the players will be able to open the lobby menu from the NPC/Marker point. (Higher value equals higher distance interaction)
Config.Zones = {
{
name = 'Arena1', -- Name of the arena (can be anything)
type = 'Arena', -- Keep it as it is (don't change)
coords = vec3(-2206.3691, 256.4317, 197.1043), -- Set here the coords where the game menu can be opened and players can join the que [the npc will be at these coords if enabled]
-- Blip settings (Won't be needed if Config.EnableBlips is set to false)
blipname = 'Arena 1',
blipspriteid = 647,
blipscale = 1.0,
blipcolour = 39,
-- NPC Settings (will be enabled if enablenpc is set to = true)
enablenpc = true,
npcmodel = 's_m_y_blackops_02', -- Website too see peds name: https://wiki.rage.mp/index.php?title=Peds
npcheading = 180.00
},
--[[ You can add multiple arena points from where people will be able to access the game lobby (You can put as many as you want if needed, just remove the comment lines and add new arenas)
{
name = 'Arena2', -- Name of the arena (can be anything)
type = 'Arena',
coords = vec3(-1926.5983, 279.9223, 42.0235),
-- Blip settings (Won't be needed if Config.EnableBlips is set to false)
blipname = 'Arena 2',
blipspriteid = 647,
blipscale = 1.0,
blipcolour = 39,
-- NPC Settings (will be enabled if enablenpc is set to = true)
enablenpc = true,
npcmodel = 's_m_m_movspace_01',
npcheading = 170.00,
}
]]
}
-- Setup Teleport Settings (last value is the heading of the player in Β° [Updated in version 1.3.1])
Config.TeleportCoords = {
teleport_zone_1 = vec4(899.0878, 3023.4456, 42.8279, 180.00),
teleport_zone_2 = vec4(868.9520, 3053.3884, 40.5407, 180.00),
teleport_zone_3 = vec4(-1550.9320, -843.8948, 10.1496, 180.00),
}
Config.TeleportCoordsAfterDeathMatchIsFinished = vec4(-2210.2119, 268.0514, 198.1043, 180.00) -- Set up here the coords to where all players will be sent after the deathmatch is finished or when they die during the deathmatch
-- SQL Settings
Config.RefreshSQLTime = 60 -- The server query will update the leaderboard data every 60 seconds. It's reccomended to keep it to atleast 60 for better server performance
-- Translate everything according to your language there.
Config.Translation = {
["open_menu"] = "[E] - Open Matchmaking menu",
["game_finished"] = "The game has finished! Thanks for playing.",
["game_won_ox"] = "You won the deathmatch lobby: ",
["game_won_ox_all_left"] = "The last player left! You won the deathmatch lobby: ",
["ox_game_won_title"] = "Congratulations! You are the WINNER!",
["ox_game_lost_title"] = "You lost!",
["game_lost"] = "You died! But the next time you will be prepared! You were alive for: ",
["game_won"] = "You won the deathmatch",
["game_won_teleport"] = "You will now be teleported back to spawn",
["teleport_arena_title"] = "Starting game",
["teleport_arena_msg"] = "You have been teleported to the arena! Fight for victory!",
["already_playing"] = "Already in game",
["already_playing_message"] = "You are already playing in a deathmatch lobby",
["minutes"] = ' minutes',
}
--[[INTEGRATION:
If you want to integrate the Leaderboard in your custom menu, you will have to call this TriggerEvent [client]:
TriggerEvent("open-deluxedeathmatch-gamemenu")
If you want to integrate the game lobby in your custom menu, you will have to call this TriggerEvent [client]:
TriggerEvent("open-deluxedeathmatch-leaderboard")
]]
```
You can setup webhooks for event as well. It's pretty simple and it's explained there:
```lua
--ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
--ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
--βββββββββββββββββββββββββββββ¦βββββββββββββββββββββββββββββββββββββββββ
--ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
--βββββββββββββββββββββββββββββ¦βββββββββββββββββββββββββββββββββββββββββ
--ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Config.EnableWebHook = false -- Enable or disable the discord logs (death-match lobby winner) [true = active, false = disabled]
Config.WebhookURL = '' -- Your discord webhook link
Config.WebhookTitle = 'Deluxe Deathmatch Logs' -- The webhook title
-- Color Settings
Config.WebhookColor = '3145631' -- Green, Red: 16711680, Yellow: 16777073
```