mirror of
https://github.com/jimathy/rpemotes.git
synced 2026-03-31 06:34:20 -04:00
Major Update - Credits To Scully 🙂
* Major Update - Convert to RPEmotes. - Add support for colors on particles. - Removed an unusual check when using the pay emote function. - Added config option to change cancel key. - Changed all keys to lowercase to prevent the "key no worky" bug. - Changed the open key to f4. - Improved and cleaner version check. - Updated events as the usage was deprecated. - Added a check to remove any unsupported emotes such as ones unsupported from game builds and improved the adult animation removal. * Fix * Changes * Update README.md
This commit is contained in:
46
README.md
46
README.md
@@ -1,6 +1,6 @@
|
||||
# DpEmotes 🏋️
|
||||
# RpEmotes 🏋️
|
||||
|
||||
DpEmotes is a Community driven FiveM menu allowing players to express themselves in roleplay with custom animations, countless facial expressions, walkstyles and props, originally created by [DullPear](https://github.com/andristum/dpemotes).
|
||||
RpEmotes is a community driven FiveM emote menu allowing players to express themselves in roleplay with custom animations, countless facial expressions, walkstyles and props, originally created by [DullPear](https://github.com/andristum/dpemotes).
|
||||
|
||||
<img src="https://forum.cfx.re/uploads/default/original/4X/7/1/b/71b1b02319fd6b8d20f64d6a8a90f4f1ccaf5dfa.png" width="700">
|
||||
|
||||
@@ -52,11 +52,11 @@ DpEmotes is a Community driven FiveM menu allowing players to express themselves
|
||||
|
||||
* Swedish 🇸🇪
|
||||
|
||||
All languages were translate or contributed by you, the community with the odd exception of using Google Translate
|
||||
All languages were translated or contributed by you, the community with the odd exception of using Google Translate.
|
||||
|
||||
If you happen to find any incorrect translations or would like to add more languages, please feel free to make a Pull Request with the correct / additional translations, or join our discord.
|
||||
If you happen to find any incorrect translations or would like to add more languages, please feel free to make a pull request with the correct / additional translations or join our discord.
|
||||
|
||||
Languages can be selected and/or added in the config.lua.
|
||||
Languages can be selected and / or added in the config.lua.
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -80,7 +80,7 @@ Languages can be selected and/or added in the config.lua.
|
||||
|
||||
- Further support for shared and couple poses / animations 👫
|
||||
|
||||
- Easily convert Menyoo to dpemotes 🔄
|
||||
- Easily convert Menyoo to rpemotes 🔄
|
||||
|
||||
- Hide Adult Emotes 🔞
|
||||
|
||||
@@ -91,25 +91,25 @@ Languages can be selected and/or added in the config.lua.
|
||||
- Standalone exports to play anim, cancel anim and block (or not) the cancel key
|
||||
|
||||
```lua
|
||||
exports["dpemotes"]:EmoteCommandStart(emoteName, textureVariation)
|
||||
exports["dpemotes"]:EmoteCancel(forceCancel) – forceCancel is optional
|
||||
exports["dpemotes"]:CanCancelEmote(state)
|
||||
exports["rpemotes"]:EmoteCommandStart(emoteName, textureVariation)
|
||||
exports["rpemotes"]:EmoteCancel(forceCancel) – forceCancel is optional
|
||||
exports["rpemotes"]:CanCancelEmote(state)
|
||||
```
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Menu Keybind 🎛️
|
||||
|
||||
The keybind uses RegisterKeyMapping. By default, the server configured keybind in the *initial* config.lua will be the default key, however once the keybind is set for a user, it'll stay with this new value. Editing the config keybind will change it for new players only.
|
||||
The keybind uses RegisterKeyMapping. By default the configured keybind in the *initial* config.lua will be the default key, however once the keybind is set for a user it'll remain and can be changed in the users settings under `Esc > settings > keybinds > fivem`.
|
||||
|
||||
|
||||
**Menu key:** F5
|
||||
**Menu key:** F4
|
||||
|
||||
Server owners can change this in the `config.lua`.
|
||||
|
||||
Alternatively, the player base can set their own menu keybind to open DpEmotes
|
||||
Alternatively, the player base can set their own menu keybind to open RpEmotes
|
||||
|
||||
Esc > settings > keybinds > fivem > dpemotes
|
||||
`Esc > settings > keybinds > fivem`
|
||||
|
||||
* More keybinds are now using key mappings which means that they are now available in your FiveM settings to change (`FavKeybind` and `RagdollKeybind`)
|
||||
|
||||
@@ -117,9 +117,7 @@ Esc > settings > keybinds > fivem > dpemotes
|
||||
|
||||
# Keybinds and SQL 🎛️
|
||||
|
||||
The original DpEmotes uses mysql-async which was then changed to ghmattimysql. Unfortunately, they are no longer maintained.
|
||||
|
||||
To use the SQL features, install the latest version of the [oxmysql](https://github.com/overextended/oxmysql) resource. If you do not want to use the SQL features, comment out the `oxmysql` region in fxmanifest.lua.
|
||||
To use the SQL features, install the latest version of the [oxmysql](https://github.com/overextended/oxmysql) resource. If you do not want to use the SQL features keep the `oxmysql` region in fxmanifest.lua commented out.
|
||||
|
||||
Alternatively, you can use the keybind command that comes with FiveM without having the SQL, by entering the following into F8:
|
||||
|
||||
@@ -151,7 +149,7 @@ Alternatively, you can also hide animal emotes.
|
||||
|
||||
# QBCore ⚙️
|
||||
|
||||
**QBCore integration to match their fork of the original dpemotes**
|
||||
**QBCore integration to match their fork of dpemotes**
|
||||
|
||||
- Config option which supports the QB Framework in their fork of dpemotes
|
||||
|
||||
@@ -174,7 +172,7 @@ If you’re using qb-core, you can now set `Framework = "qb-core"` in the config
|
||||
|
||||
# Installation Instructions ⚙️:
|
||||
|
||||
* Add DpEmotes to your `server.cfg`
|
||||
* Add RpEmotes to your `server.cfg`
|
||||
|
||||
* Download the latest recommended artifacts [for Windows](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/) or [for Linux](https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)
|
||||
|
||||
@@ -190,11 +188,11 @@ Alternatively, you can use the keybind command that comes with FiveM without hav
|
||||
|
||||
`bind keyboard "Yourbutton" "e youremote"`. To remove the keybind, type `"unbind keyboard "Yourbutton"`.
|
||||
|
||||
* Start dpemotes
|
||||
* Start rpemotes
|
||||
|
||||
# Additional Instructions ⚙️
|
||||
|
||||
- **[Please check the fivem forum thread](https://forum.fivem.net/t/dpemotes-356ish-emotes-usable-while-walking-props-and-more/843105)**
|
||||
- **[Please check the fivem forum thread](https://forum.fivem.net/t/rpemotes-356ish-emotes-usable-while-walking-props-and-more/843105)**
|
||||
|
||||
- **Check out my youtube playlist below:**
|
||||
|
||||
@@ -250,13 +248,13 @@ By default, the main prop will share it's coordinates with the particle effect,
|
||||
|
||||
If no prop is uses in the animation or you require the particle effect to be in a different location, use `PtfxNoProp = true`, and 0.0 will 9/10 times be the human peds' stomach; you can then offset your coordinates based on that with the first 3 entries being XYZ, and the last 3 being rotation XYZ.
|
||||
|
||||
Using Menyoo, spawn down a tennis ball and attach it to human, by default menyoo will attach it to the SKEL_ROOT bone (stomach), so from that, what we can do is offset the coordinates, say, up to the human ped's mouth, and then once we've got it correct, we can transfer those coordinates over to dpemotes, and tah dah, we have our Ptfx Placement.
|
||||
Using Menyoo, spawn down a tennis ball and attach it to human, by default menyoo will attach it to the SKEL_ROOT bone (stomach), so from that, what we can do is offset the coordinates, say, up to the human ped's mouth, and then once we've got it correct, we can transfer those coordinates over to rpemotes, and tah dah, we have our Ptfx Placement.
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Adding Your Own Animations ⚙️
|
||||
|
||||
Because the menu gets updated frequently, the files get overwritten. To avoid this, you can add your own / downloaded animation files `(.ycd)` inside of a newly created folder, give it a name, and place it in the `dpemotes\stream\[Custom Emotes]` folder.
|
||||
Because the menu gets updated frequently, the files get overwritten. To avoid this, you can add your own / downloaded animation files `(.ycd)` inside of a newly created folder, give it a name, and place it in the `rpemotes\stream\[Custom Emotes]` folder.
|
||||
|
||||
Add your animation code to the `AnimationListCustom.lua` and make a backup of this file, call it `BackUpAnimationListCustom.lua`.
|
||||
|
||||
@@ -289,9 +287,9 @@ This project does not contain a license however is in compliance with express cu
|
||||
|
||||
You are not allowed to change / add a license.
|
||||
|
||||
These usage rights do not carry over to any third party including any other forks and/or projects without express permission and must not be extracted from [TayMcKenzieNZ's fork of DpEmotes](https://github.com/TayMcKenzieNZ/dpemotes).
|
||||
These usage rights do not carry over to any third party including any other forks and/or projects without express permission and must not be extracted from [RpEmotes](https://github.com/TayMcKenzieNZ/rpemotes).
|
||||
|
||||
If you want to modify this particular fork of DpEmotes ***(does not apply if you want to use it for personal purposes)*** or make an agreement, you can contact TayMcKenzieNZ via Discord. Pull requests are actively reviewed and discussed with TayMcKenzieNZ and contributors and will be accepted as long as they do not contain breaking changes.
|
||||
If you want to modify RpEmotes ***(does not apply if you want to use it for personal purposes)*** or make an agreement, you can contact TayMcKenzieNZ via Discord. Pull requests are actively reviewed and discussed with TayMcKenzieNZ and contributors and will be accepted as long as they do not contain breaking changes.
|
||||
|
||||
You can read more about unlicensed repositories [here](https://opensource.stackexchange.com/questions/1720/what-can-i-assume-if-a-publicly-published-project-has-no-license) if questions remain.
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
-- DPEmotes forked by TayMcKenzieNZ requires you to be on the latest FiveM Gamebuild for all emotes to function. --
|
||||
-- ALL custon animations added to this fork were added with express permission from the creators and does not contain any paid content --
|
||||
-- ALL custon animations added to this repository were added with express permission from the creators and does not contain any paid content --
|
||||
-- If an emote does not work, you may be on an older gamebuild. --
|
||||
-- To get a higher gamebuild, see ReadMe on github repositorty --
|
||||
|
||||
|
||||
DP = {}
|
||||
RP = {}
|
||||
|
||||
-- EXPRESSIONS --
|
||||
|
||||
DP.Expressions = {
|
||||
RP.Expressions = {
|
||||
["Aiming"] = {
|
||||
"Expression",
|
||||
"mood_aiming_1"
|
||||
@@ -126,7 +125,7 @@ DP.Expressions = {
|
||||
|
||||
--- WALKSTYLES ---
|
||||
|
||||
DP.Walks = {
|
||||
RP.Walks = {
|
||||
-- The key shouldn't have any other uppercase letter than the first one!
|
||||
-- The first letter HAS to be uppercase!
|
||||
-- First element of array is the walk animation
|
||||
@@ -528,7 +527,7 @@ DP.Walks = {
|
||||
|
||||
--- SHARED EMOTES ---
|
||||
|
||||
DP.Shared = {
|
||||
RP.Shared = {
|
||||
|
||||
--[emotename] = {dictionary, animation, displayname, targetemotename, additionalanimationoptions} --
|
||||
-- You don't have to specify targetemotename; If you don't, it will just play the same animation on both.--
|
||||
@@ -1452,7 +1451,7 @@ DP.Shared = {
|
||||
|
||||
--- DANCING EMOTES, SOME WITH PROPS ---
|
||||
|
||||
DP.Dances = {
|
||||
RP.Dances = {
|
||||
["dance"] = {
|
||||
"anim@amb@nightclub@dancers@podium_dancers@",
|
||||
"hi_dance_facedj_17_v2_male^5",
|
||||
@@ -2800,7 +2799,7 @@ DP.Dances = {
|
||||
---- ANIMAL EMOTES ----
|
||||
---- BIG DOG ----
|
||||
|
||||
DP.AnimalEmotes = {
|
||||
RP.AnimalEmotes = {
|
||||
["bdogbark"] = {
|
||||
"creatures@rottweiler@amb@world_dog_barking@idle_a",
|
||||
"idle_a",
|
||||
@@ -4551,7 +4550,7 @@ DP.AnimalEmotes = {
|
||||
|
||||
--- EMOTES NO PROPS ---
|
||||
|
||||
DP.Emotes = {
|
||||
RP.Emotes = {
|
||||
|
||||
["dispenser"] = {
|
||||
"mini@sprunk",
|
||||
@@ -7927,7 +7926,7 @@ DP.Emotes = {
|
||||
}
|
||||
|
||||
--- EMOTES WITH 1 OR 2 PROPS ---
|
||||
DP.PropEmotes = {
|
||||
RP.PropEmotes = {
|
||||
["umbrella"] = {
|
||||
"amb@world_human_drinking@coffee@male@base",
|
||||
"base",
|
||||
@@ -11467,7 +11466,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microck"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microck"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p1",
|
||||
"mic@p1",
|
||||
"Microphone Rock",
|
||||
@@ -11486,7 +11485,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckb"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckb"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p2",
|
||||
"mic@p2",
|
||||
"Microphone Rock 2",
|
||||
@@ -11505,7 +11504,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckc"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckc"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p3",
|
||||
"mic@p3",
|
||||
"Microphone Rock 3",
|
||||
@@ -11524,7 +11523,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckd"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckd"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p4",
|
||||
"mic@p4",
|
||||
"Microphone Rock 4",
|
||||
@@ -11543,7 +11542,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microcke"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microcke"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p5",
|
||||
"mic@p5",
|
||||
"Microphone Rock 5",
|
||||
@@ -11562,7 +11561,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckf"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckf"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p6",
|
||||
"mic@p6",
|
||||
"Microphone Rock 6",
|
||||
@@ -11581,7 +11580,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckg"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckg"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p7",
|
||||
"mic@p7",
|
||||
"Microphone Rock 7",
|
||||
@@ -11600,7 +11599,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckh"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckh"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p8",
|
||||
"mic@p8",
|
||||
"Microphone Rock 8",
|
||||
@@ -11619,7 +11618,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microcki"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microcki"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p9",
|
||||
"mic@p9",
|
||||
"Microphone Rock 9",
|
||||
@@ -11638,7 +11637,7 @@ DP.PropEmotes = {
|
||||
EmoteMoving = true,
|
||||
}
|
||||
},
|
||||
["microckj"] = { --- Custom Emote Provided To TayMcKenzieNZ's DpEmotes Fork By Prue颜
|
||||
["microckj"] = { --- Custom Emote Provided To RpEmotes By Prue颜
|
||||
"lunyx@mic@p10",
|
||||
"mic@p10",
|
||||
"Microphone Rock 10",
|
||||
@@ -15395,18 +15394,23 @@ DP.PropEmotes = {
|
||||
}
|
||||
|
||||
-- Remove emotes if needed
|
||||
if Config.AdultEmotesDisabled then
|
||||
for _, array in ipairs({
|
||||
"Shared",
|
||||
"Dances",
|
||||
"AnimalEmotes",
|
||||
"Emotes",
|
||||
"PropEmotes",
|
||||
}) do
|
||||
for emoteName, emoteData in pairs(DP[array]) do
|
||||
if emoteData.AdultAnimation then
|
||||
DP[array][emoteName] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local emoteTypes = {
|
||||
"Shared",
|
||||
"Dances",
|
||||
"AnimalEmotes",
|
||||
"Emotes",
|
||||
"PropEmotes",
|
||||
}
|
||||
|
||||
for i = 1, #emoteTypes do
|
||||
local emoteType = emoteTypes[i]
|
||||
for emoteName, emoteData in pairs(RP[emoteType]) do
|
||||
local shouldRemove = false
|
||||
if Config.AdultEmotesDisabled and emoteData.AdultAnimation then shouldRemove = true end
|
||||
if emoteData[1] and not DoesAnimDictExist(emoteData[1]) then shouldRemove = true end
|
||||
if emoteData.AnimationOptions and emoteData.AnimationOptions.Prop and not IsModelValid(joaat(emoteData.AnimationOptions.Prop)) then shouldRemove = true end
|
||||
if emoteData.AnimationOptions and emoteData.AnimationOptions.SecondProp and not IsModelValid(joaat(emoteData.AnimationOptions.SecondProp)) then shouldRemove = true end
|
||||
if shouldRemove then RP[emoteType][emoteName] = nil end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,11 +11,11 @@ CustomDP.PropEmotes = {}
|
||||
|
||||
-- Add the custom emotes
|
||||
for arrayName, array in pairs(CustomDP) do
|
||||
if DP[arrayName] then
|
||||
if RP[arrayName] then
|
||||
for emoteName, emoteData in pairs(array) do
|
||||
-- We don't add adult animations if not needed
|
||||
if not emoteData.AdultAnimation or not Config.AdultEmotesDisabled then
|
||||
DP[arrayName][emoteName] = emoteData
|
||||
RP[arrayName][emoteName] = emoteData
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
100
client/Emote.lua
100
client/Emote.lua
@@ -60,11 +60,11 @@ local function RunAnimationThread()
|
||||
end
|
||||
|
||||
if Config.EnableXtoCancel then
|
||||
RegisterKeyMapping("emotecancel", "Cancel current emote", "keyboard", "X")
|
||||
RegisterKeyMapping("emotecancel", "Cancel current emote", "keyboard", Config.CancelEmoteKey)
|
||||
end
|
||||
|
||||
if Config.MenuKeybindEnabled then
|
||||
RegisterKeyMapping("emotemenu", "Open dpemotes menu", "keyboard", Config.MenuKeybind)
|
||||
RegisterKeyMapping("emotemenu", "Open rpemotes menu", "keyboard", Config.MenuKeybind)
|
||||
end
|
||||
|
||||
if Config.HandsupKeybindEnabled then
|
||||
@@ -92,7 +92,7 @@ Citizen.CreateThread(function()
|
||||
{ name = "emotename", help = "dance, camera, sit or any valid emote." } })
|
||||
TriggerEvent('chat:addSuggestion', '/emotebinds', 'Check your currently bound emotes.')
|
||||
end
|
||||
TriggerEvent('chat:addSuggestion', '/emotemenu', 'Open dpemotes menu (F5) by default.')
|
||||
TriggerEvent('chat:addSuggestion', '/emotemenu', 'Open rpemotes menu (F5) by default.')
|
||||
TriggerEvent('chat:addSuggestion', '/emotes', 'List available emotes.')
|
||||
TriggerEvent('chat:addSuggestion', '/walk', 'Set your walkingstyle.',
|
||||
{ { name = "style", help = "/walks for a list of valid styles" } })
|
||||
@@ -102,17 +102,17 @@ Citizen.CreateThread(function()
|
||||
TriggerEvent('chat:addSuggestion', '/pointing', 'Finger pointing.')
|
||||
end)
|
||||
|
||||
RegisterCommand('e', function(source, args, raw) EmoteCommandStart(source, args, raw) end)
|
||||
RegisterCommand('emote', function(source, args, raw) EmoteCommandStart(source, args, raw) end)
|
||||
RegisterCommand('e', function(source, args, raw) EmoteCommandStart(source, args, raw) end, false)
|
||||
RegisterCommand('emote', function(source, args, raw) EmoteCommandStart(source, args, raw) end, false)
|
||||
if Config.SqlKeybinding then
|
||||
RegisterCommand('emotebind', function(source, args, raw) EmoteBindStart(source, args, raw) end)
|
||||
RegisterCommand('emotebinds', function(source, args, raw) EmoteBindsStart(source, args, raw) end)
|
||||
RegisterCommand('emotebind', function(source, args, raw) EmoteBindStart(source, args, raw) end, false)
|
||||
RegisterCommand('emotebinds', function(source, args, raw) EmoteBindsStart(source, args, raw) end, false)
|
||||
end
|
||||
RegisterCommand('emotemenu', function(source, args, raw) OpenEmoteMenu() end)
|
||||
RegisterCommand('emotes', function(source, args, raw) EmotesOnCommand() end)
|
||||
RegisterCommand('walk', function(source, args, raw) WalkCommandStart(source, args, raw) end)
|
||||
RegisterCommand('walks', function(source, args, raw) WalksOnCommand() end)
|
||||
RegisterCommand('emotecancel', function(source, args, raw) EmoteCancel() end)
|
||||
RegisterCommand('emotemenu', function(source, args, raw) OpenEmoteMenu() end, false)
|
||||
RegisterCommand('emotes', function(source, args, raw) EmotesOnCommand() end, false)
|
||||
RegisterCommand('walk', function(source, args, raw) WalkCommandStart(source, args, raw) end, false)
|
||||
RegisterCommand('walks', function(source, args, raw) WalksOnCommand() end, false)
|
||||
RegisterCommand('emotecancel', function(source, args, raw) EmoteCancel() end, false)
|
||||
|
||||
RegisterCommand('handsup', function(source, args, raw)
|
||||
if Config.HandsupKeybindEnabled then
|
||||
@@ -122,7 +122,8 @@ RegisterCommand('handsup', function(source, args, raw)
|
||||
EmoteCommandStart(nil, {"handsup"}, nil)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end, false)
|
||||
|
||||
RegisterCommand('pointing', function(source, args, raw)
|
||||
if Config.PointingKeybindEnabled then
|
||||
local ped = PlayerPedId()
|
||||
@@ -187,7 +188,7 @@ RegisterCommand('pointing', function(source, args, raw)
|
||||
Pointing = false
|
||||
end
|
||||
end
|
||||
end)
|
||||
end, false)
|
||||
|
||||
AddEventHandler('onResourceStop', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
@@ -286,6 +287,7 @@ AddStateBagChangeHandler('ptfx', nil, function(bagName, key, value, _unused, rep
|
||||
local offset = stateBag.ptfxOffset
|
||||
local rot = stateBag.ptfxRot
|
||||
local scale = stateBag.ptfxScale or 1
|
||||
local color = stateBag.ptfxColor
|
||||
local propNet = stateBag.ptfxPropNet
|
||||
local entityTarget = plyPed
|
||||
-- Only do for valid obj
|
||||
@@ -296,10 +298,15 @@ AddStateBagChangeHandler('ptfx', nil, function(bagName, key, value, _unused, rep
|
||||
end
|
||||
end
|
||||
PtfxThis(asset)
|
||||
PlayerParticles[plyId] = StartNetworkedParticleFxLoopedOnEntityBone(name, entityTarget, offset.x, offset.y,
|
||||
offset.z, rot.x, rot.y, rot.z, GetEntityBoneIndexByName(name, "VFX"), scale + 0.0, 0, 0, 0, 1065353216,
|
||||
1065353216, 1065353216, 0)
|
||||
SetParticleFxLoopedColour(PlayerParticles[plyId], 1.0, 1.0, 1.0)
|
||||
PlayerParticles[plyId] = StartNetworkedParticleFxLoopedOnEntityBone(name, entityTarget, offset.x, offset.y, offset.z, rot.x, rot.y, rot.z, GetEntityBoneIndexByName(name, "VFX"), scale + 0.0, 0, 0, 0, 1065353216, 1065353216, 1065353216, 0)
|
||||
if color then
|
||||
if color[1] and type(color[1]) == 'table' then
|
||||
local randomIndex = math.random(1, #color)
|
||||
color = color[randomIndex]
|
||||
end
|
||||
SetParticleFxLoopedAlpha(PlayerParticles[plyId], color.A)
|
||||
SetParticleFxLoopedColour(PlayerParticles[plyId], color.R / 255, color.G / 255, color.B / 255, false)
|
||||
end
|
||||
DebugPrint("Started PTFX: " .. PlayerParticles[plyId])
|
||||
else
|
||||
-- Stop ptfx
|
||||
@@ -313,7 +320,7 @@ end)
|
||||
|
||||
function EmotesOnCommand(source, args, raw)
|
||||
local EmotesCommand = ""
|
||||
for a in pairsByKeys(DP.Emotes) do
|
||||
for a in pairsByKeys(RP.Emotes) do
|
||||
EmotesCommand = EmotesCommand .. "" .. a .. ", "
|
||||
end
|
||||
EmoteChatMessage(EmotesCommand)
|
||||
@@ -343,26 +350,26 @@ function EmoteMenuStart(args, hard, textureVariation)
|
||||
local etype = hard
|
||||
|
||||
if etype == "dances" then
|
||||
if DP.Dances[name] ~= nil then
|
||||
if OnEmotePlay(DP.Dances[name]) then end
|
||||
if RP.Dances[name] ~= nil then
|
||||
OnEmotePlay(RP.Dances[name])
|
||||
end
|
||||
elseif etype == "animals" then
|
||||
if DP.AnimalEmotes[name] ~= nil then
|
||||
if OnEmotePlay(DP.AnimalEmotes[name]) then end
|
||||
if RP.AnimalEmotes[name] ~= nil then
|
||||
OnEmotePlay(RP.AnimalEmotes[name])
|
||||
end
|
||||
elseif etype == "props" then
|
||||
if DP.PropEmotes[name] ~= nil then
|
||||
if OnEmotePlay(DP.PropEmotes[name], textureVariation) then end
|
||||
if RP.PropEmotes[name] ~= nil then
|
||||
OnEmotePlay(RP.PropEmotes[name], textureVariation)
|
||||
end
|
||||
elseif etype == "emotes" then
|
||||
if DP.Emotes[name] ~= nil then
|
||||
if OnEmotePlay(DP.Emotes[name]) then end
|
||||
if RP.Emotes[name] ~= nil then
|
||||
OnEmotePlay(RP.Emotes[name])
|
||||
else
|
||||
if name ~= "🕺 Dance Emotes" then end
|
||||
end
|
||||
elseif etype == "expression" then
|
||||
if DP.Expressions[name] ~= nil then
|
||||
if OnEmotePlay(DP.Expressions[name]) then end
|
||||
if RP.Expressions[name] ~= nil then
|
||||
OnEmotePlay(RP.Expressions[name])
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -382,35 +389,35 @@ function EmoteCommandStart(source, args, raw)
|
||||
return
|
||||
end
|
||||
|
||||
if DP.Emotes[name] ~= nil then
|
||||
if OnEmotePlay(DP.Emotes[name]) then end
|
||||
if RP.Emotes[name] ~= nil then
|
||||
OnEmotePlay(RP.Emotes[name])
|
||||
return
|
||||
elseif DP.Dances[name] ~= nil then
|
||||
if OnEmotePlay(DP.Dances[name]) then end
|
||||
elseif RP.Dances[name] ~= nil then
|
||||
OnEmotePlay(RP.Dances[name])
|
||||
return
|
||||
elseif DP.AnimalEmotes[name] ~= nil then
|
||||
if OnEmotePlay(DP.AnimalEmotes[name]) then end
|
||||
elseif RP.AnimalEmotes[name] ~= nil then
|
||||
OnEmotePlay(RP.AnimalEmotes[name])
|
||||
return
|
||||
elseif DP.PropEmotes[name] ~= nil then
|
||||
if DP.PropEmotes[name].AnimationOptions.PropTextureVariations then
|
||||
elseif RP.PropEmotes[name] ~= nil then
|
||||
if RP.PropEmotes[name].AnimationOptions.PropTextureVariations then
|
||||
if #args > 1 then
|
||||
local textureVariation = tonumber(args[2])
|
||||
if (DP.PropEmotes[name].AnimationOptions.PropTextureVariations[textureVariation] ~= nil) then
|
||||
if OnEmotePlay(DP.PropEmotes[name], textureVariation - 1) then end
|
||||
if (RP.PropEmotes[name].AnimationOptions.PropTextureVariations[textureVariation] ~= nil) then
|
||||
OnEmotePlay(RP.PropEmotes[name], textureVariation - 1)
|
||||
return
|
||||
else
|
||||
local str = ""
|
||||
for k, v in ipairs(DP.PropEmotes[name].AnimationOptions.PropTextureVariations) do
|
||||
for k, v in ipairs(RP.PropEmotes[name].AnimationOptions.PropTextureVariations) do
|
||||
str = str .. string.format("\n(%s) - %s", k, v.Name)
|
||||
end
|
||||
|
||||
EmoteChatMessage(string.format(Config.Languages[lang]['invalidvariation'], str), true)
|
||||
if OnEmotePlay(DP.PropEmotes[name], 0) then end
|
||||
OnEmotePlay(RP.PropEmotes[name], 0)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
if OnEmotePlay(DP.PropEmotes[name]) then end
|
||||
OnEmotePlay(RP.PropEmotes[name])
|
||||
return
|
||||
else
|
||||
EmoteChatMessage("'" .. name .. "' " .. Config.Languages[lang]['notvalidemote'] .. "")
|
||||
@@ -602,6 +609,7 @@ function OnEmotePlay(EmoteName, textureVariation)
|
||||
PtfxNoProp = false
|
||||
end
|
||||
Ptfx1, Ptfx2, Ptfx3, Ptfx4, Ptfx5, Ptfx6, PtfxScale = table.unpack(EmoteName.AnimationOptions.PtfxPlacement)
|
||||
PtfxColor = EmoteName.AnimationOptions.PtfxColor
|
||||
PtfxInfo = EmoteName.AnimationOptions.PtfxInfo
|
||||
PtfxWait = EmoteName.AnimationOptions.PtfxWait
|
||||
PtfxCanHold = EmoteName.AnimationOptions.PtfxCanHold
|
||||
@@ -609,8 +617,8 @@ function OnEmotePlay(EmoteName, textureVariation)
|
||||
PtfxPrompt = true
|
||||
-- RunAnimationThread() -- ? This call should not be required, see if needed with tests
|
||||
|
||||
TriggerServerEvent("dpemotes:ptfx:sync", PtfxAsset, PtfxName, vector3(Ptfx1, Ptfx2, Ptfx3),
|
||||
vector3(Ptfx4, Ptfx5, Ptfx6), PtfxScale)
|
||||
TriggerServerEvent("rpemotes:ptfx:sync", PtfxAsset, PtfxName, vector3(Ptfx1, Ptfx2, Ptfx3),
|
||||
vector3(Ptfx4, Ptfx5, Ptfx6), PtfxScale, PtfxColor)
|
||||
else
|
||||
DebugPrint("Ptfx = none")
|
||||
PtfxPrompt = false
|
||||
@@ -651,12 +659,10 @@ function OnEmotePlay(EmoteName, textureVariation)
|
||||
|
||||
-- Ptfx is on the prop, then we need to sync it
|
||||
if EmoteName.AnimationOptions.PtfxAsset and not PtfxNoProp then
|
||||
TriggerServerEvent("dpemotes:ptfx:syncProp", ObjToNet(prop))
|
||||
TriggerServerEvent("rpemotes:ptfx:syncProp", ObjToNet(prop))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
TriggerServerEvent("dp:CheckVersion")
|
||||
|
||||
rightPosition = { x = 1450, y = 100 }
|
||||
leftPosition = { x = 0, y = 100 }
|
||||
menuPosition = { x = 0, y = 200 }
|
||||
@@ -39,11 +37,11 @@ end
|
||||
|
||||
-- Clear all the animal emotes if disabled.
|
||||
if not Config.AnimalEmotesEnabled then
|
||||
DP.AnimalEmotes = {}
|
||||
for k, v in pairs(DP) do
|
||||
RP.AnimalEmotes = {}
|
||||
for k, v in pairs(RP) do
|
||||
for i, j in pairs(v) do
|
||||
if j.AnimalEmote then
|
||||
DP[k][i] = nil
|
||||
RP[k][i] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -126,7 +124,7 @@ function AddEmoteMenu(menu)
|
||||
submenu:AddItem(keyinfo)
|
||||
end
|
||||
|
||||
for a, b in pairsByKeys(DP.Emotes) do
|
||||
for a, b in pairsByKeys(RP.Emotes) do
|
||||
x, y, z = table.unpack(b)
|
||||
emoteitem = NativeUI.CreateItem(z, "/e (" .. a .. ")")
|
||||
submenu:AddItem(emoteitem)
|
||||
@@ -136,7 +134,7 @@ function AddEmoteMenu(menu)
|
||||
end
|
||||
end
|
||||
|
||||
for a, b in pairsByKeys(DP.Dances) do
|
||||
for a, b in pairsByKeys(RP.Dances) do
|
||||
x, y, z = table.unpack(b)
|
||||
danceitem = NativeUI.CreateItem(z, "/e (" .. a .. ")")
|
||||
dancemenu:AddItem(danceitem)
|
||||
@@ -151,7 +149,7 @@ function AddEmoteMenu(menu)
|
||||
end
|
||||
|
||||
if Config.AnimalEmotesEnabled then
|
||||
for a, b in pairsByKeys(DP.AnimalEmotes) do
|
||||
for a, b in pairsByKeys(RP.AnimalEmotes) do
|
||||
x, y, z = table.unpack(b)
|
||||
animalitem = NativeUI.CreateItem(z, "/e (" .. a .. ")")
|
||||
animalmenu:AddItem(animalitem)
|
||||
@@ -163,7 +161,7 @@ function AddEmoteMenu(menu)
|
||||
end
|
||||
|
||||
if Config.SharedEmotesEnabled then
|
||||
for a, b in pairsByKeys(DP.Shared) do
|
||||
for a, b in pairsByKeys(RP.Shared) do
|
||||
x, y, z, otheremotename = table.unpack(b)
|
||||
if otheremotename == nil then
|
||||
shareitem = NativeUI.CreateItem(z, "/nearby (~g~" .. a .. "~w~)")
|
||||
@@ -177,7 +175,7 @@ function AddEmoteMenu(menu)
|
||||
end
|
||||
end
|
||||
|
||||
for a, b in pairsByKeys(DP.PropEmotes) do
|
||||
for a, b in pairsByKeys(RP.PropEmotes) do
|
||||
x, y, z = table.unpack(b)
|
||||
|
||||
if b.AnimationOptions.PropTextureVariations then
|
||||
@@ -232,7 +230,7 @@ function AddEmoteMenu(menu)
|
||||
if ShareTable[index] ~= 'none' then
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
_, _, rename = table.unpack(DP.Shared[ShareTable[index]])
|
||||
_, _, rename = table.unpack(RP.Shared[ShareTable[index]])
|
||||
TriggerServerEvent("ServerEmoteRequest", GetPlayerServerId(target), ShareTable[index])
|
||||
SimpleNotify(Config.Languages[lang]['sentrequestto'] .. GetPlayerName(target))
|
||||
else
|
||||
@@ -244,7 +242,7 @@ function AddEmoteMenu(menu)
|
||||
shareddancemenu.OnItemSelect = function(sender, item, index)
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
_, _, rename = table.unpack(DP.Dances[DanceTable[index]])
|
||||
_, _, rename = table.unpack(RP.Dances[DanceTable[index]])
|
||||
TriggerServerEvent("ServerEmoteRequest", GetPlayerServerId(target), DanceTable[index], 'Dances')
|
||||
SimpleNotify(Config.Languages[lang]['sentrequestto'] .. GetPlayerName(target))
|
||||
else
|
||||
@@ -288,7 +286,7 @@ if Config.Search then
|
||||
local input = GetOnscreenKeyboardResult()
|
||||
if input ~= nil then
|
||||
local results = {}
|
||||
for k, v in pairs(DP) do
|
||||
for k, v in pairs(RP) do
|
||||
if not ignoredCategories[k] then
|
||||
for a, b in pairs(v) do
|
||||
if string.find(string.lower(a), string.lower(input)) or (b[3] ~= nil and string.find(string.lower(b[3]), string.lower(input))) then
|
||||
@@ -368,7 +366,7 @@ if Config.Search then
|
||||
elseif data.table == "Shared" then
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
_, _, rename = table.unpack(DP.Shared[data.name])
|
||||
_, _, rename = table.unpack(RP.Shared[data.name])
|
||||
TriggerServerEvent("ServerEmoteRequest", GetPlayerServerId(target), data.name)
|
||||
SimpleNotify(Config.Languages[lang]['sentrequestto'] .. GetPlayerName(target))
|
||||
else
|
||||
@@ -388,7 +386,7 @@ if Config.Search then
|
||||
local data = results[index]
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
_, _, rename = table.unpack(DP.Dances[data.name])
|
||||
_, _, rename = table.unpack(RP.Dances[data.name])
|
||||
TriggerServerEvent("ServerEmoteRequest", GetPlayerServerId(target), data.name, 'Dances')
|
||||
SimpleNotify(Config.Languages[lang]['sentrequestto'] .. GetPlayerName(target))
|
||||
else
|
||||
@@ -441,7 +439,7 @@ function AddWalkMenu(menu)
|
||||
submenu:AddItem(WalkInjured)
|
||||
table.insert(WalkTable, "move_m@injured")
|
||||
|
||||
for a, b in pairsByKeys(DP.Walks) do
|
||||
for a, b in pairsByKeys(RP.Walks) do
|
||||
x, label = table.unpack(b)
|
||||
walkitem = NativeUI.CreateItem(label or a, "/walk (" .. string.lower(a) .. ")")
|
||||
submenu:AddItem(walkitem)
|
||||
@@ -465,7 +463,7 @@ function AddFaceMenu(menu)
|
||||
submenu:AddItem(facereset)
|
||||
table.insert(FaceTable, "")
|
||||
|
||||
for a, b in pairsByKeys(DP.Expressions) do
|
||||
for a, b in pairsByKeys(RP.Expressions) do
|
||||
x, y, z = table.unpack(b)
|
||||
faceitem = NativeUI.CreateItem(a, "")
|
||||
submenu:AddItem(faceitem)
|
||||
@@ -570,14 +568,14 @@ function ProcessMenu()
|
||||
isMenuProcessing = false
|
||||
end
|
||||
|
||||
RegisterNetEvent("dp:Update")
|
||||
AddEventHandler("dp:Update", function(state)
|
||||
RegisterNetEvent("rp:Update")
|
||||
AddEventHandler("rp:Update", function(state)
|
||||
UpdateAvailable = state
|
||||
AddInfoMenu(mainMenu)
|
||||
_menuPool:RefreshIndex()
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dp:RecieveMenu") -- For opening the emote menu from another resource.
|
||||
AddEventHandler("dp:RecieveMenu", function()
|
||||
RegisterNetEvent("rp:RecieveMenu") -- For opening the emote menu from another resource.
|
||||
AddEventHandler("rp:RecieveMenu", function()
|
||||
OpenEmoteMenu()
|
||||
end)
|
||||
|
||||
@@ -21,7 +21,7 @@ if Config.SqlKeybinding then
|
||||
while true do
|
||||
if NetworkIsPlayerActive(PlayerId()) and not Initialized then
|
||||
if not Initialized then
|
||||
TriggerServerEvent("dp:ServerKeybindExist")
|
||||
TriggerServerEvent("rp:ServerKeybindExist")
|
||||
Wait(5000)
|
||||
end
|
||||
end
|
||||
@@ -43,17 +43,17 @@ if Config.SqlKeybinding then
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dp:ClientKeybindExist")
|
||||
AddEventHandler("dp:ClientKeybindExist", function(does)
|
||||
RegisterNetEvent("rp:ClientKeybindExist")
|
||||
AddEventHandler("rp:ClientKeybindExist", function(does)
|
||||
if does then
|
||||
TriggerServerEvent("dp:ServerKeybindGrab")
|
||||
TriggerServerEvent("rp:ServerKeybindGrab")
|
||||
else
|
||||
TriggerServerEvent("dp:ServerKeybindCreate")
|
||||
TriggerServerEvent("rp:ServerKeybindCreate")
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dp:ClientKeybindGet")
|
||||
AddEventHandler("dp:ClientKeybindGet", function(k1, e1, k2, e2, k3, e3, k4, e4, k5, e5, k6, e6)
|
||||
RegisterNetEvent("rp:ClientKeybindGet")
|
||||
AddEventHandler("rp:ClientKeybindGet", function(k1, e1, k2, e2, k3, e3, k4, e4, k5, e5, k6, e6)
|
||||
keyb1 = k1
|
||||
emob1 = e1
|
||||
keyb2 = k2
|
||||
@@ -69,8 +69,8 @@ if Config.SqlKeybinding then
|
||||
Initialized = true
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dp:ClientKeybindGetOne")
|
||||
AddEventHandler("dp:ClientKeybindGetOne", function(key, e)
|
||||
RegisterNetEvent("rp:ClientKeybindGetOne")
|
||||
AddEventHandler("rp:ClientKeybindGetOne", function(key, e)
|
||||
SimpleNotify(Config.Languages[lang]['bound'] ..
|
||||
"~y~" .. e .. "~w~ " .. Config.Languages[lang]['to'] .. " ~g~" .. firstToUpper(key) .. "~w~")
|
||||
if key == "num4" then emob1 = e
|
||||
@@ -107,12 +107,12 @@ if Config.SqlKeybinding then
|
||||
local key = string.lower(args[1])
|
||||
local emote = string.lower(args[2])
|
||||
if (Config.KeybindKeys[key]) ~= nil then
|
||||
if DP.Emotes[emote] ~= nil then
|
||||
TriggerServerEvent("dp:ServerKeybindUpdate", key, emote)
|
||||
elseif DP.Dances[emote] ~= nil then
|
||||
TriggerServerEvent("dp:ServerKeybindUpdate", key, emote)
|
||||
elseif DP.PropEmotes[emote] ~= nil then
|
||||
TriggerServerEvent("dp:ServerKeybindUpdate", key, emote)
|
||||
if RP.Emotes[emote] ~= nil then
|
||||
TriggerServerEvent("rp:ServerKeybindUpdate", key, emote)
|
||||
elseif RP.Dances[emote] ~= nil then
|
||||
TriggerServerEvent("rp:ServerKeybindUpdate", key, emote)
|
||||
elseif RP.PropEmotes[emote] ~= nil then
|
||||
TriggerServerEvent("rp:ServerKeybindUpdate", key, emote)
|
||||
else
|
||||
EmoteChatMessage("'" .. emote .. "' " .. Config.Languages[lang]['notvalidemote'] .. "")
|
||||
end
|
||||
|
||||
@@ -14,8 +14,8 @@ if Config.SharedEmotesEnabled then
|
||||
local emotename = string.lower(args[1])
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
if DP.Shared[emotename] ~= nil then
|
||||
dict, anim, ename = table.unpack(DP.Shared[emotename])
|
||||
if RP.Shared[emotename] ~= nil then
|
||||
dict, anim, ename = table.unpack(RP.Shared[emotename])
|
||||
TriggerServerEvent("ServerEmoteRequest", GetPlayerServerId(target), emotename)
|
||||
SimpleNotify(Config.Languages[lang]['sentrequestto'] ..
|
||||
GetPlayerName(target) .. " ~w~(~g~" .. ename .. "~w~)")
|
||||
@@ -37,32 +37,32 @@ AddEventHandler("SyncPlayEmote", function(emote, player)
|
||||
Wait(300)
|
||||
targetPlayerId = player
|
||||
-- wait a little to make sure animation shows up right on both clients after canceling any previous emote
|
||||
if DP.Shared[emote] ~= nil then
|
||||
if DP.Shared[emote].AnimationOptions and DP.Shared[emote].AnimationOptions.Attachto then
|
||||
if RP.Shared[emote] ~= nil then
|
||||
if RP.Shared[emote].AnimationOptions and RP.Shared[emote].AnimationOptions.Attachto then
|
||||
-- We do not want to attach the player if the target emote already is attached to player
|
||||
-- this would cause issue where both player would be attached to each other and fall under the map
|
||||
local targetEmote = DP.Shared[emote][4]
|
||||
if not targetEmote or not DP.Shared[targetEmote] or not DP.Shared[targetEmote].AnimationOptions or
|
||||
not DP.Shared[targetEmote].AnimationOptions.Attachto then
|
||||
local targetEmote = RP.Shared[emote][4]
|
||||
if not targetEmote or not RP.Shared[targetEmote] or not RP.Shared[targetEmote].AnimationOptions or
|
||||
not RP.Shared[targetEmote].AnimationOptions.Attachto then
|
||||
local plyServerId = GetPlayerFromServerId(player)
|
||||
local ply = PlayerPedId()
|
||||
local pedInFront = GetPlayerPed(plyServerId ~= 0 and plyServerId or GetClosestPlayer())
|
||||
local bone = DP.Shared[emote].AnimationOptions.bone or -1 -- No bone
|
||||
local xPos = DP.Shared[emote].AnimationOptions.xPos or 0.0
|
||||
local yPos = DP.Shared[emote].AnimationOptions.yPos or 0.0
|
||||
local zPos = DP.Shared[emote].AnimationOptions.zPos or 0.0
|
||||
local xRot = DP.Shared[emote].AnimationOptions.xRot or 0.0
|
||||
local yRot = DP.Shared[emote].AnimationOptions.yRot or 0.0
|
||||
local zRot = DP.Shared[emote].AnimationOptions.zRot or 0.0
|
||||
local bone = RP.Shared[emote].AnimationOptions.bone or -1 -- No bone
|
||||
local xPos = RP.Shared[emote].AnimationOptions.xPos or 0.0
|
||||
local yPos = RP.Shared[emote].AnimationOptions.yPos or 0.0
|
||||
local zPos = RP.Shared[emote].AnimationOptions.zPos or 0.0
|
||||
local xRot = RP.Shared[emote].AnimationOptions.xRot or 0.0
|
||||
local yRot = RP.Shared[emote].AnimationOptions.yRot or 0.0
|
||||
local zRot = RP.Shared[emote].AnimationOptions.zRot or 0.0
|
||||
AttachEntityToEntity(ply, pedInFront, GetPedBoneIndex(pedInFront, bone), xPos, yPos, zPos, xRot, yRot,
|
||||
zRot, false, false, false, true, 1, true)
|
||||
end
|
||||
end
|
||||
|
||||
if OnEmotePlay(DP.Shared[emote]) then end
|
||||
OnEmotePlay(RP.Shared[emote])
|
||||
return
|
||||
elseif DP.Dances[emote] ~= nil then
|
||||
if OnEmotePlay(DP.Dances[emote]) then end
|
||||
elseif RP.Dances[emote] ~= nil then
|
||||
OnEmotePlay(RP.Dances[emote])
|
||||
return
|
||||
end
|
||||
end)
|
||||
@@ -77,7 +77,7 @@ AddEventHandler("SyncPlayEmoteSource", function(emote, player)
|
||||
local SyncOffsetFront = 1.0
|
||||
local SyncOffsetSide = 0.0
|
||||
|
||||
local AnimationOptions = DP.Shared[emote] and DP.Shared[emote].AnimationOptions
|
||||
local AnimationOptions = RP.Shared[emote] and RP.Shared[emote].AnimationOptions
|
||||
if AnimationOptions then
|
||||
if AnimationOptions.SyncOffsetFront then
|
||||
SyncOffsetFront = AnimationOptions.SyncOffsetFront + 0.0
|
||||
@@ -106,11 +106,11 @@ AddEventHandler("SyncPlayEmoteSource", function(emote, player)
|
||||
EmoteCancel()
|
||||
Wait(300)
|
||||
targetPlayerId = player
|
||||
if DP.Shared[emote] ~= nil then
|
||||
if OnEmotePlay(DP.Shared[emote]) then end
|
||||
if RP.Shared[emote] ~= nil then
|
||||
OnEmotePlay(RP.Shared[emote])
|
||||
return
|
||||
elseif DP.Dances[emote] ~= nil then
|
||||
if OnEmotePlay(DP.Dances[emote]) then end
|
||||
elseif RP.Dances[emote] ~= nil then
|
||||
OnEmotePlay(RP.Dances[emote])
|
||||
return
|
||||
end
|
||||
end)
|
||||
@@ -136,9 +136,9 @@ AddEventHandler("ClientEmoteRequestReceive", function(emotename, etype)
|
||||
requestedemote = emotename
|
||||
|
||||
if etype == 'Dances' then
|
||||
_, _, remote = table.unpack(DP.Dances[requestedemote])
|
||||
_, _, remote = table.unpack(RP.Dances[requestedemote])
|
||||
else
|
||||
_, _, remote = table.unpack(DP.Shared[requestedemote])
|
||||
_, _, remote = table.unpack(RP.Shared[requestedemote])
|
||||
end
|
||||
|
||||
PlaySound(-1, "NAV", "HUD_AMMO_SHOP_SOUNDSET", 0, 0, 1)
|
||||
@@ -151,10 +151,10 @@ Citizen.CreateThread(function()
|
||||
if IsControlJustPressed(1, 246) and isRequestAnim then
|
||||
target, distance = GetClosestPlayer()
|
||||
if (distance ~= -1 and distance < 3) then
|
||||
if DP.Shared[requestedemote] ~= nil then
|
||||
_, _, _, otheremote = table.unpack(DP.Shared[requestedemote])
|
||||
elseif DP.Dances[requestedemote] ~= nil then
|
||||
_, _, _, otheremote = table.unpack(DP.Dances[requestedemote])
|
||||
if RP.Shared[requestedemote] ~= nil then
|
||||
_, _, _, otheremote = table.unpack(RP.Shared[requestedemote])
|
||||
elseif RP.Dances[requestedemote] ~= nil then
|
||||
_, _, _, otheremote = table.unpack(RP.Dances[requestedemote])
|
||||
end
|
||||
if otheremote == nil then otheremote = requestedemote end
|
||||
TriggerServerEvent("ServerValidEmote", GetPlayerServerId(target), requestedemote, otheremote)
|
||||
@@ -195,7 +195,7 @@ end
|
||||
|
||||
function NearbysOnCommand(source, args, raw)
|
||||
local NearbysCommand = ""
|
||||
for a in pairsByKeys(DP.Shared) do
|
||||
for a in pairsByKeys(RP.Shared) do
|
||||
NearbysCommand = NearbysCommand .. "" .. a .. ", "
|
||||
end
|
||||
EmoteChatMessage(NearbysCommand)
|
||||
|
||||
@@ -14,7 +14,7 @@ end
|
||||
|
||||
function WalksOnCommand(source, args, raw)
|
||||
local WalksCommand = ""
|
||||
for a in pairsByKeys(DP.Walks) do
|
||||
for a in pairsByKeys(RP.Walks) do
|
||||
WalksCommand = WalksCommand .. "" .. string.lower(a) .. ", "
|
||||
end
|
||||
EmoteChatMessage(WalksCommand)
|
||||
@@ -29,8 +29,8 @@ function WalkCommandStart(source, args, raw)
|
||||
return
|
||||
end
|
||||
|
||||
if tableHasKey(DP.Walks, name) then
|
||||
local name2 = table.unpack(DP.Walks[name])
|
||||
if tableHasKey(RP.Walks, name) then
|
||||
local name2 = table.unpack(RP.Walks[name])
|
||||
WalkMenuStart(name2)
|
||||
elseif name == "Injured" then
|
||||
WalkMenuStart("move_m@injured")
|
||||
|
||||
40
config.lua
40
config.lua
@@ -1,5 +1,4 @@
|
||||
--- Dpemotes by DullPear is a free FiveM script ---
|
||||
--- This release was forked and updated by TayMcKenzieNZ and the community ---
|
||||
--- Maintained by TayMcKenzieNZ for the community ---
|
||||
--- Leakers and resellers are the absolute scum of the earth ---
|
||||
|
||||
Config = {
|
||||
@@ -12,16 +11,17 @@ Config = {
|
||||
DebugDisplay = false,
|
||||
-- Set this to false if you have something else on X, and then just use /e c to cancel emotes.
|
||||
EnableXtoCancel = true,
|
||||
CancelEmoteKey = 'x', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
-- Set this to true if you want to disarm the player when they play an emote.
|
||||
DisarmPlayer = false,
|
||||
-- Set this if you really wanna disable emotes in cars, as of 1.7.2 they only play the upper body part if in vehicle
|
||||
AllowedInCars = true,
|
||||
-- You can disable the menu here / change the keybind. It is currently set to F5
|
||||
MenuKeybindEnabled = true,
|
||||
MenuKeybind = 'F5', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
MenuKeybind = 'f4', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
-- You can disable the Favorite emote keybinding here.
|
||||
FavKeybindEnabled = true,
|
||||
FavKeybind = 'CAPITAL', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
FavKeybind = 'capital', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
-- You can change the header image for the menu here
|
||||
-- Use a 512 x 128 image!
|
||||
-- Note this might cause an issue of the image getting stuck on peoples screens
|
||||
@@ -34,7 +34,7 @@ Config = {
|
||||
MenuPosition = "right", -- (left, right)
|
||||
-- You can enable or disable the Ragdoll keybinding here.
|
||||
RagdollEnabled = false,
|
||||
RagdollKeybind = 'U', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
RagdollKeybind = 'u', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
-- You can enable or disable Ragdoll as Toggle here. Only works if RagdollEnabled is set to true.
|
||||
RagdollAsToggle = true,
|
||||
-- You can disable the Facial Expressions menu here.
|
||||
@@ -61,10 +61,10 @@ Config = {
|
||||
Search = true,
|
||||
-- You can disable the handsup here / change the keybind. It is currently set to H
|
||||
HandsupKeybindEnabled = false,
|
||||
HandsupKeybind = 'H', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
HandsupKeybind = 'h', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
-- You can disable the fingrer pointing here / change the keybind. It is currently set to B
|
||||
PointingKeybindEnabled = false,
|
||||
PointingKeybind = 'B', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
PointingKeybind = 'b', -- Get the button string here https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
|
||||
CheckForUpdates = true,
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ Config.Languages = {
|
||||
['moods'] = "Humores 😒",
|
||||
['infoupdate'] = "Crédito e agradecimento 🙏🏻",
|
||||
['infoupdateav'] = "Informação (Atualização disponível)",
|
||||
['infoupdateavtext'] = "Uma atualização disponível, veja ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~ para pegar",
|
||||
['infoupdateavtext'] = "Uma atualização disponível, veja ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~ para pegar",
|
||||
['suggestions'] = "Sugestões?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ no fórum do FiveM para qualquer sugestão de recurso/emotes! ✉️",
|
||||
['notvaliddance'] = "não é uma dança válida.",
|
||||
@@ -156,7 +156,7 @@ Config.Languages = {
|
||||
['moods'] = "Výrazy 😒",
|
||||
['infoupdate'] = "Kredity a nápady 🙏🏻",
|
||||
['infoupdateav'] = "Informace (aktualizace dostupná)",
|
||||
['infoupdateavtext'] = "Je k dispozici aktualizace, stáhněte si nejnovější verzi z ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Je k dispozici aktualizace, stáhněte si nejnovější verzi z ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Nápady?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ na FiveM forums je pro jakýkoliv návrh! ✉️",
|
||||
['notvaliddance'] = "Není platný tanec.",
|
||||
@@ -214,7 +214,7 @@ Config.Languages = {
|
||||
['moods'] = "Humør 😒",
|
||||
['infoupdate'] = "Info / Opdateringer",
|
||||
['infoupdateav'] = "Information (Opdatering tilgængelig)",
|
||||
['infoupdateavtext'] = "En opdatering er tilgænglig, hent den nyeste version fra ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "En opdatering er tilgænglig, hent den nyeste version fra ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Forslag?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ på FiveM-forum for alle funktioner/emote-forslag! ✉️",
|
||||
['notvaliddance'] = "er ikke en gyldig dans",
|
||||
@@ -272,7 +272,7 @@ Config.Languages = {
|
||||
['moods'] = "Stemmingen 😒",
|
||||
['infoupdate'] = "Credits en bedankt 🙏🏻",
|
||||
['infoupdateav'] = "Informatie (Update beschikbaar)",
|
||||
['infoupdateavtext'] = "Een update is beschikbaar, download de laatste versie via ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Een update is beschikbaar, download de laatste versie via ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Suggesties?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ op de FiveM forums om suggesties in te dienen! ✉️",
|
||||
['notvaliddance'] = "Is geen geldige dans.",
|
||||
@@ -330,7 +330,7 @@ Config.Languages = {
|
||||
['moods'] = "Moods 😒",
|
||||
['infoupdate'] = "Credits & Suggestions 🙏🏻",
|
||||
['infoupdateav'] = "Information (Update available)",
|
||||
['infoupdateavtext'] = "An update is available, get the latest version from ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "An update is available, get the latest version from ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Suggestions?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ on FiveM forums for any feature/emote suggestions! ✉️",
|
||||
['notvaliddance'] = "is not a valid dance.",
|
||||
@@ -388,7 +388,7 @@ Config.Languages = {
|
||||
['moods'] = "Mielialat 😒",
|
||||
['infoupdate'] = "Krediitit & Ehdotukset 🙏🏻",
|
||||
['infoupdateav'] = "Informaatio (Päivitys saatavilla)",
|
||||
['infoupdateavtext'] = "Uusin versio saatavilla täältä ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Uusin versio saatavilla täältä ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Ehdotukset?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ FiveM foorumeilla liittyen mihin tahansa ominaisuus/animaatio ehdotukseen! ✉️",
|
||||
['notvaliddance'] = "Ei ole tanssi.",
|
||||
@@ -446,7 +446,7 @@ Config.Languages = {
|
||||
['moods'] = "Humeurs 😒",
|
||||
['infoupdate'] = "Crédits et suggestions 🙏🏻",
|
||||
['infoupdateav'] = "Information (Mise à jour disponible)",
|
||||
['infoupdateavtext'] = "Une mise à jour est disponible ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Une mise à jour est disponible ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Suggestions?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ sur les forums FiveM pour toutes les suggestions! ✉️",
|
||||
['notvaliddance'] = "n'est pas une danse valide",
|
||||
@@ -503,7 +503,7 @@ Config.Languages = {
|
||||
['moods'] = "Stimmungen 😒",
|
||||
['infoupdate'] = "Credits und Dank 🙏🏻",
|
||||
['infoupdateav'] = "Information (Update verfügbar)",
|
||||
['infoupdateavtext'] = "Eine Aktualisierung ist verfügbar ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Eine Aktualisierung ist verfügbar ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Vorschläge?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ in FiveM-Foren für alle Feature- / Emote-Vorschläge! ✉️",
|
||||
['notvaliddance'] = "ist kein gültiger Tanz",
|
||||
@@ -560,7 +560,7 @@ Config.Languages = {
|
||||
['moods'] = "Umori 😒",
|
||||
['infoupdate'] = "Crediti e grazie 🙏🏻",
|
||||
['infoupdateav'] = "Informazioni (Aggiornamento disponibile)",
|
||||
['infoupdateavtext'] = "Un aggiornamento è disponibile, ottieni l'ulima versione qui ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Un aggiornamento è disponibile, ottieni l'ulima versione qui ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Suggerimenti?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ nei forum di FiveM per suggerimenti su funzionalitá/animazioni! ✉️",
|
||||
['notvaliddance'] = "non è un ballo valido.",
|
||||
@@ -618,7 +618,7 @@ Config.Languages = {
|
||||
['moods'] = "Nastroje 😒",
|
||||
['infoupdate'] = "Creditsy & sugestie 🙏🏻",
|
||||
['infoupdateav'] = "Informacje (aktualizacja dostępna)",
|
||||
['infoupdateavtext'] = "Dostępna jest nowa aktualizacja, pobierz ją z: ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Dostępna jest nowa aktualizacja, pobierz ją z: ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Masz sugestie?",
|
||||
['suggestionsinfo'] = "Napisz do ~r~TayMcKenzieNZ~s~ na forum FiveMa odnośnie przyszłych ficzerów czy propozycji! ✉️",
|
||||
['notvaliddance'] = "nie jest poprawnym tańcem.",
|
||||
@@ -734,7 +734,7 @@ Config.Languages = {
|
||||
['moods'] = "Настроение 😒",
|
||||
['infoupdate'] = "Признательность и предложения 🙏🏻",
|
||||
['infoupdateav'] = "Информация (Доступно обновление)",
|
||||
['infoupdateavtext'] = "Доступно обновление, загрузите последнюю версию с ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Доступно обновление, загрузите последнюю версию с ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Предложения?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ на форумах FiveM для любых предложений по функциям/эмоциям! ✉️",
|
||||
['notvaliddance'] = "не существующий танец.",
|
||||
@@ -792,7 +792,7 @@ Config.Languages = {
|
||||
['moods'] = "Estados de animo 😒",
|
||||
['infoupdate'] = "Créditos Y Sugerencias 🙏🏻",
|
||||
['infoupdateav'] = "Informacion (Actualizacion disponible)",
|
||||
['infoupdateavtext'] = "Una actualizacion esta disponible, para conseguir la ultima version ingresa a ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "Una actualizacion esta disponible, para conseguir la ultima version ingresa a ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Sugerencias?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ en el foro de FiveM para cualquier sugerencia! ✉️",
|
||||
['notvaliddance'] = "no es un baile valido.",
|
||||
@@ -849,7 +849,7 @@ Config.Languages = {
|
||||
['moods'] = "Humör 😒",
|
||||
['infoupdate'] = "Krediter Och Förslag 🙏🏻",
|
||||
['infoupdateav'] = "Information (Uppdatering tillgänglig)",
|
||||
['infoupdateavtext'] = "En uppdatering är tillgänglig ~y~https://github.com/TayMcKenzieNZ/dpemotes~w~",
|
||||
['infoupdateavtext'] = "En uppdatering är tillgänglig ~y~https://github.com/TayMcKenzieNZ/rpemotes~w~",
|
||||
['suggestions'] = "Förslag?",
|
||||
['suggestionsinfo'] = "~r~TayMcKenzieNZ~s~ på FiveM-forum för förslag på funktioner/emotes! ✉️",
|
||||
['notvaliddance'] = "är inte en giltig dans",
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
--- DPEmotes by andristum ---
|
||||
--- Forked by TayMcKenzieNZ ---
|
||||
--- Check for updates at https://github.com/TayMcKenzieNZ/dpemotes ---
|
||||
--- Maintained by TayMcKenzieNZ ---
|
||||
--- Check for updates at https://github.com/TayMcKenzieNZ/rpemotes ---
|
||||
|
||||
fx_version 'cerulean'
|
||||
|
||||
game 'gta5'
|
||||
version '1.0.0'
|
||||
lua54 'yes'
|
||||
|
||||
-- Remove the following lines if you would like to use the SQL keybinds. Requires oxmysql.
|
||||
|
||||
@@ -1 +1 @@
|
||||
print("DpEmotes forked by TayMcKenzieNZ loaded sucessfully.")
|
||||
print("RpEmotes maintained by TayMcKenzieNZ loaded sucessfully.")
|
||||
|
||||
@@ -2,26 +2,23 @@
|
||||
-- Shared Emotes Syncing ---------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
RegisterServerEvent("ServerEmoteRequest")
|
||||
AddEventHandler("ServerEmoteRequest", function(target, emotename, etype)
|
||||
RegisterNetEvent("ServerEmoteRequest", function(target, emotename, etype)
|
||||
TriggerClientEvent("ClientEmoteRequestReceive", target, emotename, etype)
|
||||
end)
|
||||
|
||||
RegisterServerEvent("ServerValidEmote")
|
||||
AddEventHandler("ServerValidEmote", function(target, requestedemote, otheremote)
|
||||
RegisterNetEvent("ServerValidEmote", function(target, requestedemote, otheremote)
|
||||
TriggerClientEvent("SyncPlayEmote", source, otheremote, target)
|
||||
TriggerClientEvent("SyncPlayEmoteSource", target, requestedemote, source)
|
||||
end)
|
||||
|
||||
RegisterServerEvent("ServerEmoteCancel")
|
||||
AddEventHandler("ServerEmoteCancel", function(target)
|
||||
RegisterNetEvent("ServerEmoteCancel", function(target)
|
||||
TriggerClientEvent("SyncCancelEmote", target, source)
|
||||
end)
|
||||
|
||||
--#region ptfx
|
||||
RegisterNetEvent("dpemotes:ptfx:sync", function(asset, name, offset, rot, scale)
|
||||
RegisterNetEvent("rpemotes:ptfx:sync", function(asset, name, offset, rot, scale, color)
|
||||
if type(asset) ~= "string" or type(name) ~= "string" or type(offset) ~= "vector3" or type(rot) ~= "vector3" then
|
||||
print("[dpemotes] ptfx:sync: invalid arguments for source:", source)
|
||||
print("[rpemotes] ptfx:sync: invalid arguments for source:", source)
|
||||
return
|
||||
end
|
||||
local srcPlayerState = Player(source).state
|
||||
@@ -30,11 +27,12 @@ RegisterNetEvent("dpemotes:ptfx:sync", function(asset, name, offset, rot, scale)
|
||||
srcPlayerState:set('ptfxOffset', offset, true)
|
||||
srcPlayerState:set('ptfxRot', rot, true)
|
||||
srcPlayerState:set('ptfxScale', scale, true)
|
||||
srcPlayerState:set('ptfxColor', color, true)
|
||||
srcPlayerState:set('ptfxPropNet', false, true)
|
||||
srcPlayerState:set('ptfx', false, true)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("dpemotes:ptfx:syncProp", function(propNet)
|
||||
RegisterNetEvent("rpemotes:ptfx:syncProp", function(propNet)
|
||||
local srcPlayerState = Player(source).state
|
||||
if propNet then
|
||||
-- Prevent infinite loop to get entity
|
||||
@@ -60,15 +58,14 @@ end)
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
local function addKeybindEventHandlers()
|
||||
RegisterServerEvent("dp:ServerKeybindExist")
|
||||
AddEventHandler('dp:ServerKeybindExist', function()
|
||||
RegisterNetEvent("rp:ServerKeybindExist", function()
|
||||
local src = source
|
||||
local srcid = GetPlayerIdentifier(source)
|
||||
MySQL.query('SELECT * FROM dpkeybinds WHERE `id`=@id;', { id = srcid }, function(dpkeybinds)
|
||||
if dpkeybinds[1] then
|
||||
TriggerClientEvent("dp:ClientKeybindExist", src, true)
|
||||
TriggerClientEvent("rp:ClientKeybindExist", src, true)
|
||||
else
|
||||
TriggerClientEvent("dp:ClientKeybindExist", src, false)
|
||||
TriggerClientEvent("rp:ClientKeybindExist", src, false)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
@@ -76,40 +73,37 @@ local function addKeybindEventHandlers()
|
||||
-- This is my first time doing SQL stuff, and after i finished everything i realized i didnt have to store the keybinds in the database at all.
|
||||
-- But remaking it now is a little pointless since it does it job just fine!
|
||||
|
||||
RegisterServerEvent("dp:ServerKeybindCreate")
|
||||
AddEventHandler("dp:ServerKeybindCreate", function()
|
||||
RegisterNetEvent("rp:ServerKeybindCreate", function()
|
||||
local src = source
|
||||
local srcid = GetPlayerIdentifier(source)
|
||||
MySQL.insert('INSERT INTO dpkeybinds (`id`, `keybind1`, `emote1`, `keybind2`, `emote2`, `keybind3`, `emote3`, `keybind4`, `emote4`, `keybind5`, `emote5`, `keybind6`, `emote6`) VALUES (@id, @keybind1, @emote1, @keybind2, @emote2, @keybind3, @emote3, @keybind4, @emote4, @keybind5, @emote5, @keybind6, @emote6);'
|
||||
,
|
||||
{ id = srcid, keybind1 = "num4", emote1 = "", keybind2 = "num5", emote2 = "", keybind3 = "num6", emote3 = "",
|
||||
keybind4 = "num7", emote4 = "", keybind5 = "num8", emote5 = "", keybind6 = "num9", emote6 = "" },
|
||||
function(created) print("[dp] ^2" .. GetPlayerName(src) .. "^7 got created!")
|
||||
TriggerClientEvent("dp:ClientKeybindGet"
|
||||
function(created) print("[rp] ^2" .. GetPlayerName(src) .. "^7 got created!")
|
||||
TriggerClientEvent("rp:ClientKeybindGet"
|
||||
, src, "num4", "", "num5", "", "num6", "", "num7", "", "num8", "", "num8", "")
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterServerEvent("dp:ServerKeybindGrab")
|
||||
AddEventHandler("dp:ServerKeybindGrab", function()
|
||||
RegisterNetEvent("rp:ServerKeybindGrab", function()
|
||||
local src = source
|
||||
local srcid = GetPlayerIdentifier(source)
|
||||
MySQL.query('SELECT keybind1, emote1, keybind2, emote2, keybind3, emote3, keybind4, emote4, keybind5, emote5, keybind6, emote6 FROM `dpkeybinds` WHERE `id` = @id'
|
||||
,
|
||||
{ ['@id'] = srcid }, function(kb)
|
||||
if kb[1].keybind1 ~= nil then
|
||||
TriggerClientEvent("dp:ClientKeybindGet", src, kb[1].keybind1, kb[1].emote1, kb[1].keybind2, kb[1].emote2
|
||||
TriggerClientEvent("rp:ClientKeybindGet", src, kb[1].keybind1, kb[1].emote1, kb[1].keybind2, kb[1].emote2
|
||||
, kb[1].keybind3, kb[1].emote3, kb[1].keybind4, kb[1].emote4, kb[1].keybind5, kb[1].emote5,
|
||||
kb[1].keybind6, kb[1].emote6)
|
||||
else
|
||||
TriggerClientEvent("dp:ClientKeybindGet", src, "num4", "", "num5", "", "num6", "", "num7", "", "num8", ""
|
||||
TriggerClientEvent("rp:ClientKeybindGet", src, "num4", "", "num5", "", "num6", "", "num7", "", "num8", ""
|
||||
, "num8", "")
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterServerEvent("dp:ServerKeybindUpdate")
|
||||
AddEventHandler("dp:ServerKeybindUpdate", function(key, emote)
|
||||
RegisterNetEvent("rp:ServerKeybindUpdate", function(key, emote)
|
||||
local src = source
|
||||
local myid = GetPlayerIdentifier(source)
|
||||
if key == "num4" then chosenk = "keybind1"
|
||||
@@ -121,22 +115,22 @@ local function addKeybindEventHandlers()
|
||||
end
|
||||
if chosenk == "keybind1" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote1=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
elseif chosenk == "keybind2" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote2=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
elseif chosenk == "keybind3" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote3=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
elseif chosenk == "keybind4" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote4=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
elseif chosenk == "keybind5" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote5=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
elseif chosenk == "keybind6" then
|
||||
MySQL.update("UPDATE dpkeybinds SET emote6=@emote WHERE id=@id", { id = myid, emote = emote },
|
||||
function() TriggerClientEvent("dp:ClientKeybindGetOne", src, key, emote) end)
|
||||
function() TriggerClientEvent("rp:ClientKeybindGetOne", src, key, emote) end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -163,9 +157,9 @@ if Config.SqlKeybinding and MySQL then
|
||||
if success then
|
||||
addKeybindEventHandlers()
|
||||
else
|
||||
print("[dp] ^3Error connecting to DB^7")
|
||||
print("[rp] ^3Error connecting to DB^7")
|
||||
end
|
||||
end)
|
||||
else
|
||||
print("[dp] ^3Sql Keybinding^7 is turned ^1off^7, if you want to enable /emotebind, set ^3SqlKeybinding = ^2true^7 in config.lua and uncomment oxmysql lines in fxmanifest.lua.")
|
||||
print("[rp] ^3Sql Keybinding^7 is turned ^1off^7, if you want to enable /emotebind, set ^3SqlKeybinding = ^2true^7 in config.lua and uncomment oxmysql lines in fxmanifest.lua.")
|
||||
end
|
||||
|
||||
@@ -1,33 +1,25 @@
|
||||
if Config.CheckForUpdates then
|
||||
Citizen.CreateThread(function()
|
||||
updatePath = "/TayMcKenzieNZ/dpemotes"
|
||||
resourceName = "dp Emotes (" .. GetCurrentResourceName() .. ")"
|
||||
PerformHttpRequest("https://raw.githubusercontent.com" .. updatePath .. "/master/version", checkVersion, "GET")
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterServerEvent("dp:CheckVersion")
|
||||
AddEventHandler("dp:CheckVersion", function()
|
||||
if updateavail then
|
||||
TriggerClientEvent("dp:Update", source, true)
|
||||
else
|
||||
TriggerClientEvent("dp:Update", source, false)
|
||||
local function VersionLog(_type, log)
|
||||
local color = _type == 'success' and '^2' or '^1'
|
||||
print(('^8[rpemotes]%s %s^7'):format(color, log))
|
||||
end
|
||||
end)
|
||||
|
||||
function checkVersion(err, responseText, headers)
|
||||
curVersion = LoadResourceFile(GetCurrentResourceName(), "version")
|
||||
|
||||
if curVersion ~= responseText and tonumber(curVersion) < tonumber(responseText) then
|
||||
updateavail = true
|
||||
print("\n^1----------------------------------------------------------------------------------^7")
|
||||
print(resourceName .. " is outdated, latest version is: ^2" .. responseText .. "^7, installed version: ^1" .. curVersion .. "^7!\nupdate from https://github.com" .. updatePath .. "")
|
||||
print("^1----------------------------------------------------------------------------------^7")
|
||||
elseif tonumber(curVersion) > tonumber(responseText) then
|
||||
print("\n^3----------------------------------------------------------------------------------^7")
|
||||
print(resourceName .. " git version is: ^2" .. responseText .. "^7, installed version: ^1" .. curVersion .. "^7!")
|
||||
print("^3----------------------------------------------------------------------------------^7")
|
||||
else
|
||||
print("\n" .. resourceName .. " is up to date. (^2" .. curVersion .. "^7)")
|
||||
local function CheckMenuVersion()
|
||||
PerformHttpRequest('https://raw.githubusercontent.com/TayMcKenzieNZ/rpemotes/master/version.txt', function(err, text, headers)
|
||||
local currentVersion = GetResourceMetadata(GetCurrentResourceName(), 'version')
|
||||
if not text then
|
||||
VersionLog('error', 'Currently unable to run a version check.')
|
||||
return
|
||||
end
|
||||
VersionLog('success', ('Current Version: %s'):format(currentVersion))
|
||||
VersionLog('success', ('Latest Version: %s'):format(text))
|
||||
if text == currentVersion then
|
||||
VersionLog('success', 'You are running the latest version.')
|
||||
else
|
||||
VersionLog('error', ('You are currently running an outdated version, please update to version %s'):format(text))
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
CheckMenuVersion()
|
||||
end
|
||||
@@ -29,11 +29,11 @@ if Config.SqlKeybinding then
|
||||
end)
|
||||
end
|
||||
|
||||
QBCore.Commands.Add('emotemenu', 'Open dpemotes menu (F3) by default.', {}, false, function(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 dpemotes menu (F3) by default.', {}, false, function(source)
|
||||
QBCore.Commands.Add('em', 'Open rpemotes menu (F3) by default.', {}, false, function(source)
|
||||
TriggerClientEvent('animations:client:EmoteMenu', source)
|
||||
end)
|
||||
|
||||
|
||||
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.0.0
|
||||
Reference in New Issue
Block a user