Skip to content

Commit

Permalink
chore: Formatting and stability work performed
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Dec 20, 2024
1 parent 346cd91 commit bf3639e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 63 deletions.
53 changes: 9 additions & 44 deletions server-data/resources/[esx_addons]/kc-unicorn/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@ AddEventHandler("kc-unicorn:lapdance", function(PlayerMoney, PlayerBirthdate, To
PreviousCamViewMode = GetFollowPedCamViewMode(Cache.Player)

if Config.Framework == "QBCore" then
index = 1
Index = 1
for value in string.gmatch(PlayerBirthdate, "[^-]+") do
Birthdate[index] = value
index = index + 1
Index = index + 1
end

index = 1
Index = 1
for value in string.gmatch(TodayDate, "[^-]+") do
Date[index] = value
index = index + 1
Index = index + 1
end

Year = Date[1] - Birthdate[1] - 4
Expand Down Expand Up @@ -467,33 +467,12 @@ AddEventHandler("kc-unicorn:lapdance", function(PlayerMoney, PlayerBirthdate, To
else
SetPedComponentVariation(Cache.SpawnPed, 8, 1) -- Topless
end
print(
"Shoes | Drawable: " .. GetPedDrawableVariation(Cache.SpawnPed, 4),
"Drawables: " .. GetNumberOfPedDrawableVariations(Cache.SpawnPed, 4),
"Texture: " .. GetPedTextureVariation(Cache.SpawnPed, 4),
"Textures: " .. GetNumberOfPedTextureVariations(Cache.SpawnPed, 4),
"Palette: " .. GetPedPaletteVariation(Cache.SpawnPed, 4)
)
print(
"Underwear | Drawable: " .. GetPedDrawableVariation(Cache.SpawnPed, 6),
"Drawables: " .. GetNumberOfPedDrawableVariations(Cache.SpawnPed, 6),
"Texture: " .. GetPedTextureVariation(Cache.SpawnPed, 6),
"Textures: " .. GetNumberOfPedTextureVariations(Cache.SpawnPed, 6),
"Palette: " .. GetPedPaletteVariation(Cache.SpawnPed, 6)
)
print(
"Underwear?? | Drawable: " .. GetPedDrawableVariation(Cache.SpawnPed, 10),
"Drawables: " .. GetNumberOfPedDrawableVariations(Cache.SpawnPed, 10),
"Texture: " .. GetPedTextureVariation(Cache.SpawnPed, 10),
"Textures: " .. GetNumberOfPedTextureVariations(Cache.SpawnPed, 10),
"Palette: " .. GetPedPaletteVariation(Cache.SpawnPed, 10)
)

if Config.Framework ~= "Standalone" then
if PlayerMoney >= Config.LegMoney then
SetPedComponentVariation(Cache.SpawnPed, 9, 1)
SetPedComponentVariation(Cache.SpawnPed, 9, 1, 0, 0)
else
SetPedComponentVariation(Cache.SpawnPed, 9, 0)
SetPedComponentVariation(Cache.SpawnPed, 9, 0, 0, 0)
end
end

Expand All @@ -503,8 +482,6 @@ AddEventHandler("kc-unicorn:lapdance", function(PlayerMoney, PlayerBirthdate, To
print("Config.Language is set to: " .. Config.Language)
print("Framework used: " .. Config.Framework)
print(Config.Language .. "", lg)
--[[ print("Birthdate split: ", Birthdate[1], Birthdate[2], Birthdate[3])
print("Date split: ", Date[1], Date[2], Date[3]) ]]
print("Year: ", Year, "Month: ", Month, "Day: ", Day)
print(GetPedDrawableVariation(Cache.SpawnPed, 1), "Head")
print(GetPedDrawableVariation(Cache.SpawnPed, 2), "Beard")
Expand Down Expand Up @@ -538,6 +515,7 @@ AddEventHandler("kc-unicorn:lapdance", function(PlayerMoney, PlayerBirthdate, To

TaskPlayAnim(Cache.SpawnPed, LoadDict("mini@strip_club@idles@stripper", true), "stripper_idle_02", 8.0, -8.0, -1, 0, 0, false, false, false)

---@diagnostic disable-next-line: missing-parameter
SetEntityCoords(Cache.Player, 116.88, -1295.04, 28.42)

------------------- First seat ----------------------
Expand Down Expand Up @@ -655,10 +633,6 @@ AddEventHandler("kc-unicorn:SetPlayerSeated", function(GetPlayerSeated, Seat1Bus
PlayerSeated = GetPlayerSeated
end)

--------

---- Lean

Citizen.CreateThread(function()
if Config.Text == "3D" then
Input = "~r~E~w~ - "
Expand Down Expand Up @@ -791,12 +765,9 @@ function LeanStart(PlyHeading)
FreezeEntityPosition(Cache.Player, false)
end

--------

---- ????

RegisterNetEvent("kc-unicorn:poledancescene")
AddEventHandler("kc-unicorn:poledancescene", function(ped, number)
AddEventHandler("kc-unicorn:poledancescene",
function(ped, number)
PedPole = NetworkGetEntityFromNetworkId(ped)
local scene = NetworkCreateSynchronisedScene(vector3(112.65, -1286.74, 28.5), vector3(0.0, 0.0, 0.0), 2, false, false, 1065353216, 0, 1.3)
NetworkAddPedToSynchronisedScene(PedPole, scene, "mini@strip_club@pole_dance@pole_dance" .. number, "pd_dance_0" .. number, 1.5, -4.0, 1, 1, 1148846080, 0)
Expand All @@ -805,10 +776,6 @@ AddEventHandler("kc-unicorn:poledancescene", function(ped, number)
TriggerServerEvent("kc-unicorn:poledancestop")
end)

--------

---- Debug

Citizen.CreateThread(function()
local Count = 0
while true do
Expand All @@ -826,8 +793,6 @@ Citizen.CreateThread(function()
end
end)

--------

RegisterNetEvent("kc-unicorn:esxplayermoney")
AddEventHandler("kc-unicorn:esxplayermoney", function(money)
PlayerMoney = money
Expand Down
3 changes: 0 additions & 3 deletions server-data/resources/[esx_addons]/kc-unicorn/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ Config.Debug = false -- If you think something is not working, you can set 'Conf
Config.DebugPolyzones = false -- Set to true if you want to display the Polyzones
Config.MoreDebug = false -- If set to true, this will print more debug about server and client lapdance seat status
Config.MoreDebugRefreshTime = 5 -- Refresh time of "Config.MoreDebug" in seconds
Config.UpdateChecker = false -- Set to false if you don't want to check for resource update on start
Config.ChangeLog = false -- Set to false if you don't want to display the changelog if new version is find

----- DO NOT TOUCH! /!\ LOCALE SYSTEM /!\
Language = {}
Expand All @@ -73,4 +71,3 @@ function Loc(text, replacement)
end
return text
end
-----------------------------------------
24 changes: 12 additions & 12 deletions server-data/resources/[esx_addons]/kc-unicorn/locales/fr.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Locale = Locale or {}

Locale.fr = { -- 'fr' est la référence qui sera utilisé par 'Config.Language'
StandaloneLapText = "Demander un lap dance", -- Définit le texte qui sera affiché au-dessus du marqueur si 'Config.Framework' est mis sur 'standalone'
LapText = "Acheter un lap dance (~g~%$~w~)", -- Définit le texte qui sera affiché au-dessus du marqueur
BoughtLapdance = "Vous avez acheté un lap dance pour %$", -- Texte de la notification lorsqu'un lap dance est acheté
StripperActive = "La strip-teaseuse est déjà occupé !", -- Texte de la notification si une strip-teaseuse est déjà occupé lorsque vous essayez d'acheter un lap dance
NotEnoughMoney = "Vous n'avez pas assez d'argent. Un lap dance coûte %$", -- Texte de la notification si le joueur n'a pas assez d'argent
AllPlacesTaken = "Toutes les places sont déjà prises", -- Texte de la notification si toutes les places sont déjà prises
lapStopped = "Ta lap dance a été interrompu !", -- Texte si la lap dance est interrompu
Lean = "Se pencher", -- Texte pour se pencher au niveau de la bar de poledance
StandaloneLeanNotice = "Appuyez sur ~INPUT_CONTEXT~ pour arrêter de vous pencher\nAppuyez sur ~INPUT_JUMP~ pour jeter de l'argent", -- Définit le texte qui sera affiché une fois penché si 'Config.Framework' est mis sur 'standalone'
LeanNotice = "Appuyez sur ~INPUT_CONTEXT~ pour arrêter de vous pencher\nAppuyez sur ~INPUT_JUMP~ pour jeter de l'argent (~g~%$~w~)", -- Définit le texte qui sera affiché une fois penché
NotEnoughCashLean = "Vous n'avez pas assez d'argent", -- Texte si le joueur n'a pas assez d'argent pour jeter un billet une fois penché
Locale.fr = {
StandaloneLapText = "Demander un lap dance",
LapText = "Acheter un lap dance (~g~%$~w~)",
BoughtLapdance = "Vous avez acheté un lap dance pour %$",
StripperActive = "La strip-teaseuse est déjà occupé !",
NotEnoughMoney = "Vous n'avez pas assez d'argent. Un lap dance coûte %$",
AllPlacesTaken = "Toutes les places sont déjà prises",
lapStopped = "Ta lap dance a été interrompu !",
Lean = "Se pencher",
StandaloneLeanNotice = "Appuyez sur ~INPUT_CONTEXT~ pour arrêter de vous pencher\nAppuyez sur ~INPUT_JUMP~ pour jeter de l'argent",
LeanNotice = "Appuyez sur ~INPUT_CONTEXT~ pour arrêter de vous pencher\nAppuyez sur ~INPUT_JUMP~ pour jeter de l'argent (~g~%$~w~)",
NotEnoughCashLean = "Vous n'avez pas assez d'argent",
}
8 changes: 4 additions & 4 deletions server-data/resources/[esx_addons]/kc-unicorn/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ Citizen.CreateThread(function()

inPoleDance = true

SetPedComponentVariation(PoledancePed2, 8, 0)
SetPedComponentVariation(PoledancePed1, 8, 0)
SetPedComponentVariation(PoledancePed2, 8, 0, 0, 0)
SetPedComponentVariation(PoledancePed1, 8, 0, 0, 0)

repeat
inPoleDance = true

TaskGoToCoordAnyMeans(PoledancePed1, 102.13, -1296.19, 28.77, 1.0, 0, 0, 0, 0xbf800000)
TaskGoToCoordAnyMeans(PoledancePed2, 112.27, -1287.22, 28.46, 1.0, 0, 0, 0, 0xbf800000)
TaskGoToCoordAnyMeans(PoledancePed1, 102.13, -1296.19, 28.77, 1.0, 0, false, 0, 0xbf800000)
TaskGoToCoordAnyMeans(PoledancePed2, 112.27, -1287.22, 28.46, 1.0, 0, false, 0, 0xbf800000)
PoleDance(PoledancePed2)

inPoleDance = true
Expand Down

0 comments on commit bf3639e

Please sign in to comment.