mirror of
https://github.com/jimathy/rpemotes.git
synced 2026-07-23 22:13:39 -04:00
1. we don't need to loop ped id, it's not going to change while in ragdoll anyway 2. correct IsPedOnFoot check, before changing declarations (wont ragdoll if exiting a vehicle, etc) 3. Wait has to be 0 to prevent sync issues as much as possible 4. supposed to be 3 booleans at the end instead of integers 5. function info is never used 6. RegisterCommand requires 3 arguments Co-authored-by: iSentrie <xvender7@gmail.com>
26 lines
750 B
Lua
26 lines
750 B
Lua
if Config.RagdollEnabled then
|
|
RegisterCommand('+ragdoll', function() Ragdoll() end, false)
|
|
RegisterCommand('-ragdoll', function() StopRagdoll() end, false)
|
|
RegisterKeyMapping("+ragdoll", "Ragdoll your character", "keyboard", Config.RagdollKeybind)
|
|
|
|
local stop = true
|
|
function Ragdoll()
|
|
local ped = PlayerPedId()
|
|
if not IsPedOnFoot(ped) then return end
|
|
if Config.RagdollAsToggle then
|
|
stop = not stop
|
|
else
|
|
stop = false
|
|
end
|
|
|
|
while not stop do
|
|
SetPedToRagdoll(ped, 1000, 1000, 0, false, false, false)
|
|
Wait(0)
|
|
end
|
|
end
|
|
|
|
function StopRagdoll()
|
|
if Config.RagdollAsToggle then return end
|
|
stop = true
|
|
end
|
|
end |