Hi,
I’m making a script menu of a clothing shop in lua language but some problem wrong.
I think this problem caused by my local tables. I think that is an syntax error but nothing happen in my console or f8 in the game.
When i try to launch the script, nothing happen on my server. I can’t see my blips.
-------------client.lua-------------
local ClothingShop = {
opened = false,
currentmenu = "main",
lastmenu = nil,
title= "Magasin de vêtements",
width = 0.2,
height = 0.04,
x = 0.9,
y = 0.08,
["main"] = {
{title="Casquette"},
{title="Chapeau"},
{title="Hauts"},
{title="Bas"},
{title="Chaussure"},
}
}
local ClothStore = {
{title="Magasin de vêtements", x=88.291, y=-1391.929, z=29.200},
{title="Magasin de vêtements", x=-718.985, y=-158.059, z=36.996},
{title="Magasin de vêtements", x=-151.204, y=-306.837, z=38.724},
{title="Magasin de vêtements", x=414.646, y=-807.452, z=29.338},
{title="Magasin de vêtements", x=-815.193, y=-1083.333, z=11.022},
{title="Magasin de vêtements", x=-1208.098, y=-782.020, z=17.163},
{title="Magasin de vêtements", x=-1457.954, y=-229.426, z=49.185},
{title="Magasin de vêtements", x=-2.777, y=6518.491, z=31.533},
{title="Magasin de vêtements", x=1681.586, y=4820.133, z=42.046},
{title="Magasin de vêtements", x=130.216, y=-202.940, z=54.505},
{title="Magasin de vêtements", x=618.701, y=2740.564, z=41.905},
{title="Magasin de vêtements", x=1199.169, y=2694.895, z=37.866},
{title="Magasin de vêtements", x=-3164.172, y=1063.927, z=20.674},
{title="Magasin de vêtements", x=-1091.373, y=2702.356, z=19.422},
}
Citizen.CreateThread(function()
for k,v in pairs(ClothStore) do
v.position = AddBlipForCoord(v.x, v.y, v.z)
SetBlipSprite(v.position, 73)
SetBlipColour(v.position, 2)
SetBlipDisplay(v.position, 4)
SetBlipScale(v.position, 0.9)
SetBlipAsShortRange(v.position, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(v.title)
EndTextCommandSetBlipName(v.position)
end
end)
local ZoneAchat = {
-- Zones d'achats pour x=1681.586, y=4820.133, z=42.046
{x=1693.9, y=4822.82, z=42.0631},
{x=1693.78, y=4819.15, z=42.0642},
{x=1690.88, y=4818.93, z=42.0631},
}
function DisplayHelpText(message)
SetTextComponentFormat("STRING")
AddTextComponentString(message)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
function CloseMenu()
ClothingShop.opened = false
end
--function DrawMenu()
--end
function DrawTitleMenu()
SetTextEntry("STRING")
AddTextComponentString("Un Titre")
SetTextFont(2)
SetTextColour(255, 255, 255, 255)
SetTextProportional(0)
SetTextRightJustify(1)
SetTextCentre(0)
SetTextScale(0.5, 0.5)
DrawText(0.9 + 0.2/2 - 0.03, 0.08 - 0.04/2 + 0.0028)
ClothingShop.opened = true
end
Citizen.CreateThread(function()
for i,b in pairs(ZoneAchat) do
while true do
Citizen.Wait(1)
local pos = GetEntityCoords(GetPlayerPed(-1))
if GetDistanceBetweenCoords(pos.x, pos.y, pos.z, b.x, b.y, b.z, true) < 2 then
DisplayHelpText("Pressez ~INPUT_CONTEXT~ pour acheter des vêtements")
if(IsControlJustReleased(1, 51))then
if ClothingShop.opened = true then
DrawTitleMenu()
else
CloseMenu()
end
end
end
end
end
end)
Cordially,
DeadOps