Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Client
- local skins = {
- -- Police --
- "s_m_y_cop_01",
- "s_f_y_cop_01",
- -- Highway --
- "s_m_y_hwaycop_01",
- -- Sheriff --
- "s_m_y_sheriff_01",
- "s_f_y_sheriff_01",
- -- Ranger --
- "s_m_y_ranger_01",
- "s_f_y_ranger_01",
- }
- RegisterNetEvent("revive")
- AddEventHandler("revive", function()
- if CheckSkin(GetPlayerPed(-1)) then
- CancelEvent()
- local plyCoords = GetEntityCoords(GetPlayerPed(-1), true)
- ResurrectPed(GetPlayerPed(-1))
- SetEntityHealth(GetPlayerPed(-1), 200)
- ClearPedTasksImmediately(GetPlayerPed(-1))
- SetEntityCoords(GetPlayerPed(-1), plyCoords.x, plyCoords.y, plyCoords.z + 1.0, 0, 0, 0, 0)
- end)
- function CheckSkin(ped)
- for i = 1, #skins do
- if GetHashKey(skins[i]) == GetEntityModel(ped) then
- return true
- end
- end
- return false
- end
- Server
- if cm[1] == "/revive" then
- CancelEvent()
- if tablelength(cm) > 1 then
- local tPID = tonumber(cm[2])
- TriggerClientEvent("revive", tPID)
- end
- end
- end)
- function stringsplit(self, delimiter)
- local a = self:Split(delimiter)
- local t = {}
- for i = 0, #a - 1 do
- table.insert(t, a[i])
- end
- return t
- end
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement