5 gang vip de ce?
How can i put it in a hotkey and only can be used for the police? Thanks
This is how i have done it, but for this to work, you would need pNotify
vRP -> Client -> Police.lua:
RegisterNetEvent("cuff")
AddEventHandler("cuff", function()
if not tvRP.isInComa() and not tvRP.isHandcuffed() then
if IsPedInAnyVehicle(PlayerPedId(), true) then
TriggerEvent("pNotify:SendNotification",{text = "",type = "error",timeout = (5000),layout = "centerLeft",queue = "global",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
else
TriggerServerEvent('handcuff:cuffHim')
end
end
end)
vRP -> Modules -> Police.lua:
RegisterServerEvent('handcuff:checkjob')
AddEventHandler('handcuff:checkjob', function()
local source = source
local user_id = vRP.getUserId(source)
if vRP.hasPermission(user_id,"police.handcuff") then
TriggerClientEvent('cuff', source)
end
end)
RegisterServerEvent('handcuff:cuffHim')
AddEventHandler('handcuff:cuffHim', function()
local source = source
local user_id = vRP.getUserId({source})
vRPclient.getNearestPlayer(source,{1.5},function(cplayer)
if cplayer ~= nil then
vRPclient.toggleHandcuff(cplayer,{})
vRPclient.isHandcuffed(cplayer,{}, function(handcuffed)
if handcuffed then
TriggerClientEvent("pNotify:SendNotification", source,{text = {""}, type = "info", queue = "global", timeout = 3000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
else
TriggerClientEvent("pNotify:SendNotification", source,{text = {""}, type = "info", queue = "global", timeout = 3000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
end
end)
else
TriggerClientEvent("pNotify:SendNotification", source,{text = {lang.common.no_player_near()}, type = "error", queue = "global", timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
end
end)
end)
thanks, and the hotkey how can i add it for police?
It is for the police, vRP
As you can see in the path i’m directing you, then i’m directing you to police.lua, which is obv. is for the police
you dont understand me, how can i add a button to do this xDD
I already showed everyone how to do this on another thread 2 months ago:
your tutorial is a little bit bugged. The police didnt realize the animation, and then the handcuffed cant move. Do you know how to fix that? thanks
I don’t have these issues, maybe you didn’t do something right.
Thats my client-police.lua :
function tvRP.toggleHandcuff()
handcuffed = not handcuffed
SetEnableHandcuffs(GetPlayerPed(-1), handcuffed)
if handcuffed then
tvRP.playAnim(false,{{"mp_arrest_paired","crook_p2_back_right",1}},true)
Citizen.Wait(3760)
tvRP.playAnim(false,{{"mp_arresting","idle",1}},true)
TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 10, 'Cuff', 0.1)
else
tvRP.playAnim(false,{{"mp_arresting","b_uncuff"}},true)
Citizen.Wait(4500)
TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 10, 'Uncuff', 0.1)
Citizen.Wait(1500)
tvRP.stopAnim(false)
SetPedStealthMovement(GetPlayerPed(-1),false,"")
end
end
function tvRP.Handcuffer()
cuffed = not cuffed
if cuffed then
tvRP.playAnim(true,{{"mp_arrest_paired","cop_p2_back_right",1}},true)
Citizen.Wait(3500)
tvRP.stopAnim(true)
else
tvRP.playAnim(true,{{"mp_arresting","a_uncuff",1}},true)
Citizen.Wait(5500)
tvRP.stopAnim(true)
end
end
function tvRP.setHandcuffed(flag)
if handcuffed ~= flag then
tvRP.toggleHandcuff()
end
end
function tvRP.isHandcuffed()
return handcuffed
end
What if i dont have VRP
well there is a esx version of this [Release] [ESX] Advanced Arrest Animation and if you don t use any of this frameworks you ll need to make this standalone
which key to start the animation
How do u make this completey standalone for just a fx server
Error parsing script @vrp/modules/police.lua in resource vrp: @vrp/modules/police.lua:709: ‘)’ expected (to close ‘(’ at line 708) near ‘else’
Failed to load script modules/police.lua.
can someone help me?
@BYdibius @BubbleDEV
you get it in the menu it’s not on keybind
i think the server side it’s mostly vrp so replace that idk
adadada adasdasd
But which key do you press for animation? could explain in detail
best arrest animation script