oh well i have essentialmode. what i did was download your script and copied the code over to the handsup script so its being used as one resource not two. yes i copied server to server and client to client.
Client
--[[Handsup & Cuff Script]]-- Author-xander1998
RegisterNetEvent("Handcuff")
AddEventHandler("Handcuff", function()
local lPed = GetPlayerPed(-1)
if DoesEntityExist(lPed) then
Citizen.CreateThread(function()
RequestAnimDict("mp_arresting")
while not HasAnimDictLoaded("mp_arresting") do
Citizen.Wait(100)
end
if IsEntityPlayingAnim(lPed, "mp_arresting", "idle", 3) then
ClearPedSecondaryTask(lPed)
SetEnableHandcuffs(lPed, false)
else
TaskPlayAnim(lPed, "mp_arresting", "idle", 8.0, -8, -1, 49, 0, 0, 0, 0)
SetEnableHandcuffs(lPed, true)
end
end)
end
end)
RegisterNetEvent("Handsup")
AddEventHandler("Handsup", function()
local lPed = GetPlayerPed(-1)
if DoesEntityExist(lPed) then
Citizen.CreateThread(function()
RequestAnimDict("random@mugging3")
while not HasAnimDictLoaded("random@mugging3") do
Citizen.Wait(100)
end
if IsEntityPlayingAnim(lPed, "random@mugging3", "handsup_standing_base", 3) then
ClearPedSecondaryTask(lPed)
SetEnableHandcuffs(lPed, false)
TriggerEvent("chatMessage", "", {255, 0, 0}, "Your have put your hands down.")
else
TaskPlayAnim(lPed, "random@mugging3", "handsup_standing_base", 8.0, -8, -1, 49, 0, 0, 0, 0)
SetEnableHandcuffs(lPed, true)
TriggerEvent("chatMessage", "", {255, 0, 0}, "Your hands are up.")
end
end)
end
end)
--[[ DRAG SCRIPT ]]-- Author-Unknown
local drag = false
RegisterNetEvent("Drag")
AddEventHandler("Drag", function(oid)
if drag == false then
local otherPlayer = tonumber(oid)
local oPed = GetPlayerPed(GetPlayerFromServerId(otherPlayer))
local myPed = GetPlayerPed(PlayerId())
AttachEntityToEntity(myPed, oPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
elseif drag == true then
DetachEntity(GetPlayerPed(PlayerId()), true, false)
end
end)
--]]
--[[ Handsup Kneel Script]]-- Author-Coshark
function loadAnimDict( dict )
while ( not HasAnimDictLoaded( dict ) ) do
RequestAnimDict( dict )
Citizen.Wait( 5 )
end
end
RegisterNetEvent( 'KneelHU' )
AddEventHandler( 'KneelHU', function()
local player = GetPlayerPed( -1 )
if ( DoesEntityExist( player ) and not IsEntityDead( player )) then
loadAnimDict( "random@arrests" )
loadAnimDict( "random@arrests@busted" )
if ( IsEntityPlayingAnim( player, "random@arrests@busted", "idle_a", 3 ) ) then
TaskPlayAnim( player, "random@arrests@busted", "exit", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
Wait (3000)
TaskPlayAnim( player, "random@arrests", "kneeling_arrest_get_up", 8.0, 1.0, -1, 128, 0, 0, 0, 0 )
else
TaskPlayAnim( player, "random@arrests", "idle_2_hands_up", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
Wait (4000)
TaskPlayAnim( player, "random@arrests", "kneeling_arrest_idle", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
Wait (500)
TaskPlayAnim( player, "random@arrests@busted", "enter", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
Wait (1000)
TaskPlayAnim( player, "random@arrests@busted", "idle_a", 8.0, 1.0, -1, 9, 0, 0, 0, 0 )
end
end
end )
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@arrests@busted", "idle_a", 3) then
DisableControlAction(1, 140, true)
DisableControlAction(1, 141, true)
DisableControlAction(1, 142, true)
DisableControlAction(0,21,true)
end
end
end)
Server
--[[Handsup & Cuff Script]]-- Author-xander1998
AddEventHandler("chatMessage", function(source, name, message)
cm = stringsplit(message, " ")
if cm[1] == "/cuff" then
CancelEvent()
if tablelength(cm) > 1 then
local tPID = tonumber(cm[2])
TriggerClientEvent("Handcuff", tPID)
end
end
if cm[1] == "/drag" then
CancelEvent()
if tablelength(cm) > 1 then
local tPID = tonumber(cm[2])
TriggerClientEvent("Drag", tPID, source)
end
end
if cm[1] == "/hu" then
CancelEvent()
TriggerClientEvent("Handsup", source)
end
end)
--[[ Handsup Kneel Script]]-- Author-Coshark
TriggerEvent('es:addCommand', 'huk', function(source, args, user)
TriggerClientEvent('KneelHU', source, {})
end, {help = "Get down on your knees and put your hands on your head"})
--[[Stringsplit]]--
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end