Hello, how i can create one marker.
I donât understand how to complete it.
DrawMarker(uint type, float posX, float posY, float posZ, float dirX, float dirY, float dirZ, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ, int red, int green, int blue, int alpha, bool bobUpAndDown, bool faceCamera, int p19, bool rotate, string textureDict, string textureName, bool drawOnEnts);
lets try and break it downâŚ
uint type = type of marker
float posX, float posY, float posZ= x,y,z vector3 coordinates for where you want the marker
float dirX, float dirY, float dirZ= x,y,z vector3 coordinates direction marker is pointing to perhaps?
float rotX, float rotY, float rotZ= rotational degrees
float scaleX, float scaleY, float scaleZ = scale for x,y,z
int red, int green, int blue, int alpha= r,g,b,a
bool bobUpAndDown = does it move up and down? true or false
bool faceCamera = does it face the camera always? true or false
int p19 = not sure
bool rotate = does it spin? true or false
string textureDict = âmarker_dictionaryâ
string textureName = âmarker_nameâ
bool drawOnEnts = not totally sure on this one?
here is one way it might look.
local entity = PlayerPedId()
DrawMarker(-1795314153, GetEntityCoords(entity, true, false), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 0.4, 1.25, 255, 255, 0, 0, 0, 0, 2, 0, 0, 0, 0)
Thanks
I have one error: SCRIPT ERROR @bm_armeria/client.lua:32: attempt to call a nil value (global âDrawMarkerâ)
youâre including a variable without a value associated to it⌠care to paste your code?
keys = {
['G'] = 0x760A9C6F,
['S'] = 0xD27782E3,
['W'] = 0x8FD015D8,
['H'] = 0x24978A28,
['G'] = 0x5415BE48,
['E'] = 0xDFF812F9
}
local banks = {
{name="Bank", id=108, x=-245.18, y=712.2, z=113.42},
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
for k,v in pairs(PS.Coords) do
if Vdist(coords, v) < 2 then
DrawTxt("Pulsa E para no ser feo", 0.50, 0.90, 0.6, 0.6, true, 161, 3, 0, 255, true, 10000)
if IsControlJustReleased(0, keys['E']) then
print("XDD")
end
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for _, bank in pairs(bank) do
DrawMarker(1, bank.x, bank.y, bank.z - 1, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 100, 255, 128, false, false, 0, false, 0, 0, 0)
end
end
end)
function DrawTxt(str, x, y, w, h, enableShadow, col1, col2, col3, a, centre)
local str = CreateVarString(10, "LITERAL_STRING", str, Citizen.ResultAsLong())
SetTextScale(w, h)
SetTextColor(math.floor(col1), math.floor(col2), math.floor(col3), math.floor(a))
SetTextCentre(centre)
if enableShadow then SetTextDropshadow(1, 0, 0, 0, 255) end
Citizen.InvokeNative(0xADA9255D, 10);
DisplayText(str, x, y)
end
try and see if you get a return value or a nil value?
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for _, bank in pairs(bank) do
print( bank.x, bank.y, bank.z)
--DrawMarker(1, bank.x, bank.y, bank.z - 1, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 100, 255, 128, false, false, 0, false, 0, 0, 0)
end
end
end)
Had the same issue, Seems the function isnât callable under DrawMarker yet? either-way you can call it directly via Citizen.InvokeNative
e.g (Based from Miss_Behavinâs example)
local player = GetPlayerPed()
local playerLoc = GetEntityCoords(player)
Citizen.InvokeNative(0x2A32FAA57B937173, -1795314153, playerLoc.x, playerLoc.y, playerLoc.z -0.85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.25, 255, 0, 0, 255, 0, 0, 2, 0, 0, 0, 0)
I tried everything, canât make this thing work.
With javascript, both âDrawMarkerâ and âCitizen.invokeNative(â0x2A32FAA57B937173â)â wonât draw the marker.
let pos = GetEntityCoords(PlayerPedId(), true)
DrawRect(0.1,0.5, 0.1,0.1, 255,0,0,255) //To be sure that my loop work correctly. I have a red box on my screen. So everything is in order.
Citizen.invokeNative('0x2A32FAA57B937173', -1795314153, pos[0], pos[1], pos[2], 1,1,1, 1,1,1, 5,5,5, 255,0,0,255, 0, 0, 2, true, false)
Citizen.invokeNative('0x2A32FAA57B937173', -1795314153 , pos[0], pos[1], pos[2], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, 1, 2, 255, 255, 0, 0, 0, 0, 2, 0, 0, 0, 0)
Iâve tested all the code I could find online (from github, this forum and other sources).
If someone have a version of their code working, iâll definitly take it !