Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
1,721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local skins = {
  2. "s_m_y_cop_01",
  3. "s_f_y_cop_01",
  4. "s_m_y_hwaycop_01",
  5. "s_m_y_sheriff_01",
  6. "s_m_y_sheriff_02",
  7. "s_f_y_sheriff_01",
  8. "s_m_y_ranger_01",
  9. "s_f_y_ranger_01"
  10. }
  11.  
  12. function CheckSkin(ped)
  13. for i = 1, #skins do
  14. if GetHashKey(skins[i]) == GetEntityModel(ped) then
  15. return true
  16. end
  17. end
  18. return false
  19. end
  20.  
  21.  
  22.  
  23.  
  24. AddEventHandler("chatMessage", function(source, name, message)
  25. local cm = stringsplit(message, " ")
  26.  
  27. if cm[1] == "/revive" then
  28. if CheckSkin(GetPlayerPed(-1)) then
  29. CancelEvent()
  30. if tablelength(cm) > 1 then
  31. local tPID = tonumber(cm[2])
  32. TriggerClientEvent("revive", tPID)
  33. end
  34. end
  35. end)
  36.  
  37. function stringsplit(self, delimiter)
  38. local a = self:Split(delimiter)
  39. local t = {}
  40.  
  41. for i = 0, #a - 1 do
  42. table.insert(t, a[i])
  43. end
  44.  
  45. return t
  46. end
  47.  
  48. function tablelength(T)
  49. local count = 0
  50. for _ in pairs(T) do count = count + 1 end
  51. return count
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement