here is a fixed version of the code as it wouldn’t display and it translated to english
cl.lua
local canDraw = false
local canDraw2 = false
Citizen.CreateThread(function()
while true do
local waitTime = IsPedInAnyVehicle(PlayerPedId(), false) and 100 or 1000
if IsWarningMessageActive() and tonumber(GetWarningMessageTitleHash()) == 1246147334 then
ClearPedTasksImmediately(PlayerPedId())
RemoveWarningMessageListItems(1246147334)
TriggerServerEvent("InteractSound_SV:PlayOnSource", "yoursoundhere", 1.0)
Scaleforms()
end
Citizen.Wait(waitTime)
end
end)
RegisterNetEvent('s_alt:sync', function(nekruc, violator)
canDraw2 = 4000
while canDraw2 > 0 do
local koords = GetEntityCoords(PlayerPedId())
local dist = #(koords - nekruc)
if dist <= 40 then
Draw3DText(nekruc.x, nekruc.y, nekruc.z + 1.23, '~r~ALT F4~s~ [ID: ' ..violator.. ']')
end
if canDraw2 then
canDraw2 = canDraw2 - 10
end
Wait(4)
end
end)
function Scaleforms()
local scaleform = RequestScaleformMovie("MP_BIG_MESSAGE_FREEMODE")
while not HasScaleformMovieLoaded(scaleform) do
Citizen.Wait(10)
end
local coords = GetEntityCoords(PlayerPedId())
local pedid = GetPlayerServerId(PlayerId())
TriggerServerEvent('s_alt:sync', coords, pedid)
canDraw = 5000
BeginScaleformMovieMethod(scaleform, "SHOW_WEAPON_PURCHASED")
PushScaleformMovieMethodParameterString("~r~ALT F4?~s~")
PushScaleformMovieMethodParameterString("~g~Your activity has been logged, and staff is aware of your activity. (Glitch / Bug abuse)")
ScaleformMovieMethodAddParamInt(5)
EndScaleformMovieMethod()
while canDraw > 0 do
DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255)
if canDraw then
canDraw = canDraw - 10
end
Wait(5)
end
end
function Draw3DText(x, y, z, text)
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
local px, py, pz = table.unpack(GetGameplayCamCoords())
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 255)
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x, _y)
local factor = (string.len(text)) / 370
DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 0, 0, 0, 159)
end
sv.lua
RegisterServerEvent('s_alt:sync',function(coords, pid)
TriggerClientEvent('s_alt:sync', -1, coords, pid)
end)