-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09dea56
commit bc39292
Showing
1 changed file
with
27 additions
and
25 deletions.
There are no files selected for viewing
52 changes: 27 additions & 25 deletions
52
server-data/resources/[esx_addons]/rpemotes/server/frameworks/qb-core.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,56 @@ | ||
if Config.Framework ~= 'qb-core' then return end | ||
if Config.Framework ~= "qb-core" then | ||
return | ||
end | ||
|
||
local framework = 'qb-core' | ||
local framework = "qb-core" | ||
local state = GetResourceState(framework) | ||
|
||
if state == 'missing' or state == "unknown" then | ||
if state == "missing" or state == "unknown" then | ||
-- Framework can't be used if it's missing or unknown | ||
return | ||
end | ||
|
||
local QBCore = exports['qb-core']:GetCoreObject() | ||
local QBCore = exports["qb-core"]:GetCoreObject() | ||
|
||
-- https://github.com/qbcore-framework/dpemotes/blob/master/Server/Server.lua#L101-L141 | ||
QBCore.Commands.Add('e', 'Play an emote', {{ name="emotename", help="dance, camera, sit or any valid emote."}}, true, function(source, args) | ||
TriggerClientEvent('animations:client:PlayEmote', source, args) | ||
QBCore.Commands.Add("e", "Play an emote", { { name = "emotename", help = "dance, camera, sit or any valid emote." } }, true, function(source, args) | ||
TriggerClientEvent("animations:client:PlayEmote", source, args) | ||
end) | ||
|
||
QBCore.Commands.Add('emote', 'Play an emote', {{ name="emotename", help="dance, camera, sit or any valid emote."}}, true, function(source, args) | ||
TriggerClientEvent('animations:client:PlayEmote', source, args) | ||
QBCore.Commands.Add("emote", "Play an emote", { { name = "emotename", help = "dance, camera, sit or any valid emote." } }, true, function(source, args) | ||
TriggerClientEvent("animations:client:PlayEmote", source, args) | ||
end) | ||
|
||
if Config.SqlKeybinding then | ||
QBCore.Commands.Add('emotebind', 'Bind an emote', {{ name="key", help="num4, num5, num6, num7. num8, num9. Numpad 4-9!"}, { name="emotename", help="dance, camera, sit or any valid emote."}}, true, function(source, args) | ||
TriggerClientEvent('animations:client:BindEmote', source, args) | ||
QBCore.Commands.Add("emotebind", "Bind an emote", { { name = "key", help = "num4, num5, num6, num7. num8, num9. Numpad 4-9!" }, { name = "emotename", help = "dance, camera, sit or any valid emote." } }, true, function(source, args) | ||
TriggerClientEvent("animations:client:BindEmote", source, args) | ||
end) | ||
|
||
QBCore.Commands.Add('emotebinds', 'Check your currently bound emotes.', {}, false, function(source) | ||
TriggerClientEvent('animations:client:EmoteBinds', source) | ||
QBCore.Commands.Add("emotebinds", "Check your currently bound emotes.", {}, false, function(source) | ||
TriggerClientEvent("animations:client:EmoteBinds", source) | ||
end) | ||
end | ||
|
||
QBCore.Commands.Add('emotemenu', 'Open rpemotes menu (F3) by default.', {}, false, function(source) | ||
TriggerClientEvent('animations:client:EmoteMenu', source) | ||
QBCore.Commands.Add("emotemenu", "Open rpemotes menu (F3) by default.", {}, false, function(source) | ||
TriggerClientEvent("animations:client:EmoteMenu", source) | ||
end) | ||
|
||
QBCore.Commands.Add('em', 'Open rpemotes menu (F3) by default.', {}, false, function(source) | ||
TriggerClientEvent('animations:client:EmoteMenu', source) | ||
QBCore.Commands.Add("em", "Open rpemotes menu (F3) by default.", {}, false, function(source) | ||
TriggerClientEvent("animations:client:EmoteMenu", source) | ||
end) | ||
|
||
QBCore.Commands.Add('emotes', 'List available emotes.', {}, false, function(source) | ||
TriggerClientEvent('animations:client:ListEmotes', source) | ||
QBCore.Commands.Add("emotes", "List available emotes.", {}, false, function(source) | ||
TriggerClientEvent("animations:client:ListEmotes", source) | ||
end) | ||
|
||
QBCore.Commands.Add('walk', 'Set your walkingstyle.', {{ name="style", help="/walks for a list of valid styles"}}, true, function(source, args) | ||
TriggerClientEvent('animations:client:Walk', source, args) | ||
QBCore.Commands.Add("walk", "Set your walkingstyle.", { { name = "style", help = "/walks for a list of valid styles" } }, true, function(source, args) | ||
TriggerClientEvent("animations:client:Walk", source, args) | ||
end) | ||
|
||
QBCore.Commands.Add('walks', 'List available walking styles.', {}, false, function(source) | ||
TriggerClientEvent('animations:client:ListWalks', source) | ||
QBCore.Commands.Add("walks", "List available walking styles.", {}, false, function(source) | ||
TriggerClientEvent("animations:client:ListWalks", source) | ||
end) | ||
|
||
QBCore.Commands.Add('nearby', 'Share emote with a nearby player.', {{ name="emotename", help="hug, handshake, bro or any valid shared emote."}}, true, function(source, args) | ||
TriggerClientEvent('animations:client:Nearby', source, args) | ||
end) | ||
QBCore.Commands.Add("nearby", "Share emote with a nearby player.", { { name = "emotename", help = "hug, handshake, bro or any valid shared emote." } }, true, function(source, args) | ||
TriggerClientEvent("animations:client:Nearby", source, args) | ||
end) |