Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions xnTattoos/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ local scaleType = nil
local scaleString = ""

ESX = nil
Citizen.CreateThread(function()
CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
Wait(0)
end
end)

Citizen.CreateThread(function()
CreateThread(function()
AddTextEntry("ParaTattoos", "Tattoo Shop")
for k, v in pairs(Config.Shops) do
local blip = AddBlipForCoord(v)
Expand All @@ -26,6 +26,27 @@ Citizen.CreateThread(function()
end
end)

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.PlayerData = xPlayer
ESX.PlayerLoaded = true
ESX.TriggerServerCallback('SmallTattoos:GetPlayerTattoos', function(tattooList)
if tattooList then
ClearPedDecorations(PlayerPedId())
for k, v in pairs(tattooList) do
if v.Count ~= nil then
for i = 1, v.Count do
SetPedDecoration(PlayerPedId(), v.collection, v.nameHash)
end
else
SetPedDecoration(PlayerPedId(), v.collection, v.nameHash)
end
end
currentTattoos = tattooList
end
end)
end)

AddEventHandler('skinchanger:modelLoaded', function()
ESX.TriggerServerCallback('SmallTattoos:GetPlayerTattoos', function(tattooList)
if tattooList then
Expand All @@ -44,9 +65,9 @@ AddEventHandler('skinchanger:modelLoaded', function()
end)
end)

Citizen.CreateThread(function()
CreateThread(function()
while true do
Citizen.Wait(300000)
Wait(300000)
if not IsMenuOpen() then
ESX.TriggerServerCallback('SmallTattoos:GetPlayerTattoos', function(tattooList)
if tattooList then
Expand Down Expand Up @@ -134,7 +155,7 @@ end
function ReqTexts(text, slot)
RequestAdditionalText(text, slot)
while not HasAdditionalTextLoaded(slot) do
Citizen.Wait(0)
Wait(0)
end
end

Expand Down Expand Up @@ -191,7 +212,7 @@ function CreateScale(sType)
end
end

Citizen.CreateThread(function()
CreateThread(function()
JayMenu.CreateMenu("tattoo", "Tattoo Shop", function()
return CloseTattooShop()
end)
Expand All @@ -203,7 +224,7 @@ Citizen.CreateThread(function()
end

while true do
Citizen.Wait(0)
Wait(0)
local CanSleep = true
if not IsMenuOpen() then
for _,interiorId in ipairs(Config.interiorIds) do
Expand Down Expand Up @@ -344,7 +365,7 @@ Citizen.CreateThread(function()
end
end
if CanSleep then
Citizen.Wait(3000)
Wait(3000)
end
end
end)
Expand All @@ -362,7 +383,7 @@ end
function setupScaleform2(scaleform, message, button, message2, buttons, message3, button2)
local scaleform = RequestScaleformMovie(scaleform)
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
Wait(0)
end
PushScaleformMovieFunction(scaleform, "CLEAR_ALL")
PopScaleformMovieFunctionVoid()
Expand Down Expand Up @@ -406,7 +427,7 @@ end
function setupScaleform(scaleform, message, button)
local scaleform = RequestScaleformMovie(scaleform)
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(0)
Wait(0)
end
PushScaleformMovieFunction(scaleform, "CLEAR_ALL")
PopScaleformMovieFunctionVoid()
Expand Down
6 changes: 3 additions & 3 deletions xnTattoos/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fx_version 'adamant'
games { 'gta5' }
fx_version 'bodacious'
game 'gta5'

client_scripts {
'jaymenu.lua',
Expand All @@ -12,4 +12,4 @@ server_scripts {
'server.lua'
}

file 'AllTattoos.json'
file 'AllTattoos.json'
6 changes: 3 additions & 3 deletions xnTattoos/jaymenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,9 @@ function JayMenu.CloseMenu()

continuity = {}

Citizen.CreateThread(function()
CreateThread(function()
while IsDisabledControlPressed(0, 200) or IsDisabledControlJustReleased(0, 200) do
Citizen.Wait(0)
Wait(0)
DisableControlAction(0, 200, true)
end
end)
Expand Down Expand Up @@ -936,4 +936,4 @@ end

function JayMenu.SetMenuButtonPressedSound(id, name, set)
setMenuProperty(id, 'buttonPressedSound', { ['name'] = name, ['set'] = set })
end
end