I am making a script to where I want players to be able to apply for a tuner shop, but want it to be like the trash worker and tow truck jobs, where you have to go to city center to apply. Here is the code I have so far, but not sure where exactly I need to be with it:
– Define city center coordinates
local cityCenter = vector3(x, y, z)
– Function to trigger tuner job application
RegisterCommand(‘applytuner’, function(source, args, rawCommand)
local player = GetPlayerPed(-1)
local playerCoords = GetEntityCoords(player)
-- Check if the player is at the city center
if Vdist(playerCoords, cityCenter) < 10.0 then
-- Display a UI prompt for applying to the Tuner's Auto shop
TriggerEvent('chatMessage', 'SYSTEM', {255, 0, 0}, 'You are applying for the tuner job!')
-- Capture player's information and handle the application process
-- Handle data storage or processing here (not shown in this pseudocode)
else
TriggerEvent('chatMessage', 'SYSTEM', {255, 0, 0}, 'You must be at the city center to apply!')
end
end)
Any help is greatly appreciated!