Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update New tattoos + camera possitions + minor changes #19

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
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
78 changes: 77 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,83 @@ git clone https://github.com/ESX-PUBLIC/esx_tattooshop [esx]/esx_tattooshop
start esx_tattooshop
```

## Tatto Positions
### Face
-Face Front- ```addedX = 0.6, addedY=0.3,addedZ=0.7,rotZ = 116.6,```

-Face Right- ``` addedX = 0.3, addedY=-0.4,addedZ=0.6,rotZ = 382.8,```

-Face Left- ```addedX = -0.1, addedY=0.4,addedZ=0.6,rotZ = 551.7,```

### Neck
-Neck Front- ```addedX = 0.7, addedY=0.4,addedZ=0.3,rotZ = 117.3,```

-Neck Back- ```addedX = -0.7, addedY=-0.5,addedZ=0.3,rotZ = -63.5,```

-Neck Right- ```addedX = 0.3, addedY=-0.4,addedZ=0.6,rotZ = 382.8,```

-Neck Left- ```addedX = -0.3, addedY=0.3,addedZ=0.7,rotZ = 214.2,```

### Body
-Body Back- ```addedX = -0.7, addedY=-0.5,addedZ=0.3,rotZ = -63.5,```

-Body Front- ```addedX = 0.7, addedY=0.4,addedZ=0.3,rotZ = 117.3,```

-Body Right- ```addedX = 0.5, addedY=-0.3,addedZ=0.2,rotZ = 38.9,```

-Body Left- ```addedX = 0.4, addedY=0.8,addedZ=0.2,rotZ = 160.6,```

### Arms
Inside Arms - ```addedX = 0.4, addedY=0.2,addedZ=0.0,rotZ = 115.5,```

###Right Arm

-Arm Back Top Right - ```addedX = -0.2, addedY=-1.1,addedZ=0.1,rotZ = -25.5,```

-Arm Back Bottom Right - ```addedX = -0.2, addedY=-1.1,addedZ=0.1,rotZ = -25.5,```

-Arm Top Right - ```addedX = 0.2, addedY=-0.7,addedZ=0.1,rotZ = 13.6,```

-Arm Bottom Right - ```addedX = 0.3, addedY=-0.8,addedZ=0.3,rotZ = 13.6,```

-Arm Full Right - ```addedX = 0.3, addedY=-0.8,addedZ=0.2,rotZ = 13.6,```

-Arm Front Right - ```addedX = 0.8, addedY=-0.2,addedZ=0.1,rotZ = 70.0,```

###Left Arm

-Arm Back Top Left - ```addedX = 0.7, addedY=-0.5,addedZ=0.3,rotZ = -63.5,```

-Arm Back Bottom Left - ```addedX = -0.7, addedY=-0.1,addedZ=0.1,rotZ = -80.5,```

-Arm Top Left - ```addedX = -0.3, addedY=0.7,addedZ=0.4,rotZ = 551.7,```

-Arm Bottom Left - ```addedX = -0.5, addedY=0.7,addedZ=0.2,rotZ = 551.7,```

-Arm Full Left - ```addedX = -0.3, addedY=0.7,addedZ=0.2,rotZ = 551.7,```

-Arm Front Left -

### Hands
-Hand Right - ```addedX = 0.4, addedY=-0.5,addedZ=-0.1,rotZ = 24.9,```

-Hand Left - ```addedX = -0.1, addedY=0.6,addedZ=-0.1,rotZ = 181.1,```

### Legs
-Legs Back Top - ```addedX = -0.6, addedY=-0.2,addedZ=-0.4,rotZ = 290.0,```

-Legs Back Bottom - ```addedX = -0.6, addedY=-0.2,addedZ=-0.7,rotZ = 290.0,```

-Legs Front Top - ```addedX = 0.6, addedY=0.3,addedZ=-0.3,rotZ = 116.6,```

-Legs Front Bottom - ```addedX = 0.6, addedY=0.3,addedZ=-0.5,rotZ = 116.6,```

-Leg Full Right - ```addedX = 0.1, addedY=0.8,addedZ=-0.3,rotZ = 150.3,```

-Leg Full Left - ```addedX = 0.1, addedY=0.8,addedZ=-0.5,rotZ = 150.3,```


## Credits

- [n0thus](https://github.com/n0thus) who is the original developer
- [nabi11](https://github.com/nabi11) for fixing majority of tattoos
- [nabi11](https://github.com/nabi11) for fixing majority of tattoos
99 changes: 54 additions & 45 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ end)

function OpenShopMenu()
local elements = {}


for k,v in pairs(Config.TattooCategories) do
table.insert(elements, {label= v.name, value = v.value})
Expand All @@ -45,32 +46,33 @@ function OpenShopMenu()

for k,v in pairs(Config.TattooList[data.current.value]) do
table.insert(elements, {
label = _U('tattoo_item', k, _U('money_amount', ESX.Math.GroupDigits(v.price))),
label = ('%s - <span style="color:green;">%s EUR</span>'):format(v.name, ESX.Math.GroupDigits(v.price)),
value = k,
price = v.price
})
end

ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'tattoo_shop_categories', {
title = _U('tattoos') .. ' | '..currentLabel,
align = 'bottom-right',
elements = elements
}, function(data2, menu2)
local price = data2.current.price
if data2.current.value ~= nil then

ESX.TriggerServerCallback('esx_tattooshop:purchaseTattoo', function(success)
if success then
table.insert(currentTattoos, {collection = currentValue, texture = data2.current.value})
end
end, currentTattoos, price, {collection = currentValue, texture = data2.current.value})

else
OpenShopMenu()
RenderScriptCams(false, false, 0, 1, 0)
DestroyCam(cam, false)
cleanPlayer()
end
title = _U('tattoos') .. ' | '..currentLabel,
align = 'bottom-right',
elements = elements
}, function(data2, menu2)
local price = data2.current.price

if data2.current.value ~= nil then

ESX.TriggerServerCallback('esx_tattooshop:purchaseTattoo', function(success)
if success then
table.insert(currentTattoos, {collection = currentValue, texture = data2.current.value})
end
end, currentTattoos, price, {collection = currentValue, texture = data2.current.value})

else
OpenShopMenu()
RenderScriptCams(false, false, 0, 1, 0)
DestroyCam(cam, false)
cleanPlayer()
end

end, function(data2, menu2)
menu2.close()
Expand All @@ -84,7 +86,9 @@ function OpenShopMenu()
end)
end
end, function(data, menu)
local playerPed = PlayerPedId()
menu.close()
FreezeEntityPosition(playerPed, false)
setPedSkin()
end)
end
Expand Down Expand Up @@ -165,34 +169,39 @@ end)

-- Key Controls
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)

if CurrentAction then
ESX.ShowHelpNotification(CurrentActionMsg)

if IsControlJustReleased(0, 38) then
if CurrentAction == 'tattoo_shop' then
OpenShopMenu()
end
CurrentAction = nil
end
else
Citizen.Wait(500)
end
end
while true do
Citizen.Wait(0)

if CurrentAction then
ESX.ShowHelpNotification(CurrentActionMsg)

if IsControlJustReleased(0, 38) then
if CurrentAction == 'tattoo_shop' then
local playerPed = PlayerPedId()
FreezeEntityPosition(playerPed, true)
OpenShopMenu()
end
CurrentAction = nil
end
else
Citizen.Wait(500)
end
end
end)

function setPedSkin()
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
TriggerEvent('skinchanger:loadSkin', skin)
end)

Citizen.Wait(1000)

for k,v in pairs(currentTattoos) do
ApplyPedOverlay(PlayerPedId(), GetHashKey(v.collection), GetHashKey(Config.TattooList[v.collection][v.texture].nameHash))
end
local playerPed = PlayerPedId()

ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
TriggerEvent('skinchanger:loadSkin', skin)
end)

Citizen.Wait(1000)
FreezeEntityPosition(playerPed, false)

for k,v in pairs(currentTattoos) do
ApplyPedOverlay(PlayerPedId(), GetHashKey(v.collection), GetHashKey(Config.TattooList[v.collection][v.texture].nameHash))
end
end

function drawTattoo(current, collection)
Expand Down
Loading