-
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.
chore: esx_rpchat new commands available
New commands introduced - /twt - /anontwt - /me - /do
- Loading branch information
1 parent
fc96bc5
commit 2004c78
Showing
19 changed files
with
109 additions
and
80 deletions.
There are no files selected for viewing
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
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
37 changes: 26 additions & 11 deletions
37
server-data/resources/[esx_addons]/esx_rpchat/client/main.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,16 +1,31 @@ | ||
RegisterNetEvent("esx_rpchat:sendProximityMessage") | ||
AddEventHandler("esx_rpchat:sendProximityMessage", function(playerId, title, message, color) | ||
local player = PlayerId() | ||
local target = GetPlayerFromServerId(playerId) | ||
local player = PlayerId() | ||
local target = GetPlayerFromServerId(playerId) | ||
|
||
local playerPed = PlayerPedId() | ||
local targetPed = GetPlayerPed(target) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
local playerPed = PlayerPedId() | ||
local targetPed = GetPlayerPed(target) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
|
||
if target ~= -1 then | ||
if target == player or #(playerCoords - targetCoords) < 20 then | ||
TriggerEvent("chat:addMessage", { args = { title, message }, color = color }) | ||
end | ||
end | ||
if target ~= -1 then | ||
if target == player or #(playerCoords - targetCoords) < 20 then | ||
TriggerEvent("chat:addMessage", { args = { title, message }, color = color }) | ||
end | ||
end | ||
end) | ||
|
||
CreateThread(function() | ||
TriggerEvent("chat:addSuggestion", "/twt", TranslateCap("twt_help"), { { name = TranslateCap("generic_argument_name"), help = TranslateCap("generic_argument_help") } }) | ||
TriggerEvent("chat:addSuggestion", "/anontwt", TranslateCap("twtanon_help"), { { name = TranslateCap("generic_argument_name"), help = TranslateCap("generic_argument_help") } }) | ||
TriggerEvent("chat:addSuggestion", "/me", TranslateCap("me_help"), { { name = TranslateCap("generic_argument_name"), help = TranslateCap("generic_argument_help") } }) | ||
TriggerEvent("chat:addSuggestion", "/do", TranslateCap("do_help"), { { name = TranslateCap("generic_argument_name"), help = TranslateCap("generic_argument_help") } }) | ||
end) | ||
|
||
AddEventHandler("onResourceStop", function(resource) | ||
if resource == GetCurrentResourceName() then | ||
TriggerEvent("chat:removeSuggestion", "/twt") | ||
TriggerEvent("chat:removeSuggestion", "/me") | ||
TriggerEvent("chat:removeSuggestion", "/do") | ||
end | ||
end) |
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,5 +1,5 @@ | ||
Config = {} | ||
|
||
Config.Locale = "it" | ||
Config.Locale = GetConvar("esx:locale", "it") | ||
Config.OnlyFirstname = false | ||
Config.EnableESXIdentity = true -- RP names | ||
Config.EnableESXIdentity = false -- RP names |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 +1,11 @@ | ||
Locales["en"] = { | ||
["ooc_prefix"] = "OOC | %s", | ||
["twt_help"] = "send a tweet", | ||
["twt_prefix"] = "^0[^4Twitter^0] (^5@%s^0)", | ||
["me_help"] = "personal action", | ||
["me_prefix"] = "me | %s", | ||
["do_help"] = "RP information", | ||
["do_prefix"] = "do | %s", | ||
["generic_argument_name"] = "message", | ||
["generic_argument_help"] = "the message", | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 +1,11 @@ | ||
Locales["it"] = { | ||
["ooc_prefix"] = "OOC | %s", | ||
["twt_help"] = "Invia tweet", | ||
["twt_prefix"] = "^0[^4Twitter^0] (^5@%s^0)", | ||
["me_help"] = "Azione Personale", | ||
["me_prefix"] = "me | %s", | ||
["do_help"] = "Azione RP", | ||
["do_prefix"] = "fa | %s", | ||
["generic_argument_name"] = "Messaggio", | ||
["generic_argument_help"] = "il messaggio", | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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