Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- SERVER SIDE
- ]]
- -- Function to resurrect a player
- function resucitar(p)
- -- Trigger a client-side event to handle further resurrection processes
- triggerClientEvent(p, "resucito", p)
- -- Clear any animations that the player might have been performing
- setPedAnimation(p, nil, nil)
- -- Iterate through the 'varControlTable' array and enable each control for the player
- for i, v in ipairs(varControlTable) do
- toggleControl(p, v, true)
- end
- end
- -- Register the 'resucitar' function to respond to the 'resucitar' event
- addEvent("resucitar", true)
- addEventHandler("resucitar", root, resucitar)
- --[[
- CLIENT SIDE
- ]]
- -- Register and handle the 'resucito' event
- addEvent("resucito", true)
- addEventHandler("resucito", root, function()
- -- Check if there is an existing timer (timerS) and if it's running
- if timerS and isTimer(timerS) then
- -- Stop the timer and set it to nil
- killTimer(timerS)
- timerS = nil
- end
- end)
- -- Register and handle the 'resucito' event
- addEvent("resucito", true)
- addEventHandler("resucito", root, function()
- -- Check if there is an existing timer (timerS) and if it's running
- if timerS and isTimer(timerS) then
- -- Stop the timer and set it to nil
- killTimer(timerS)
- timerS = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement