Hey, everyone! Been trying to make a /911 command that sends the location as a waypoint on the GPS/minimap. I am using essentials.
My problem is, that whenever the command is executed, no marker/waypoint is set on the map/GPS. I am using base code from SPJESTER as the basis for my 911 command. I tried not using essentials, however, the marker still wouldn’t set. If you have any suggestions or know the problem, let me know! Thank you!
Here are my Client.lua:
RegisterNetEvent('set_location')
AddEventHandler('set_location', function()
SetWaypoint()
end)
function SetWaypoint()
x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
Emergency = AddBlipForCord(x, y, z)
SetBlipRoute(Emergency, true)
SetBlipSprite(Emergency, 50)
end
Here is my server.lua:
local permission = {
kick = 2,
normal = 0,
ban = 3
}
TriggerEvent('es:addAdminCommand', '911', permission.normal, function(source, args, user)
table.remove(args, 1)
TriggerClientEvent('set_location', source)
TriggerClientEvent('chatMessage', -1, "^5[911]", {30, 144, 255}, " (^1 Caller ID: ^3" .. GetPlayerName(source) .." | "..source.."^0 ) " .. table.concat(args, " "))
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficienct permissions!")
end)
Here is my __resource.lua:
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
client_script "client.lua"
server_script "server.lua"