Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local skins = {
- "s_m_y_cop_01",
- "s_f_y_cop_01",
- "s_m_y_hwaycop_01",
- "s_m_y_sheriff_01",
- "s_m_y_sheriff_02",
- "s_f_y_sheriff_01",
- "s_m_y_ranger_01",
- "s_f_y_ranger_01"
- }
- function CheckSkin(ped)
- for i = 1, #skins do
- if GetHashKey(skins[i]) == GetEntityModel(ped) then
- return true
- end
- end
- return false
- end
- AddEventHandler("chatMessage", function(source, name, message)
- local cm = stringsplit(message, " ")
- if cm[1] == "/revive" then
- if CheckSkin(GetPlayerPed(-1)) 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