Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local SWATteam = {}
  2.  
  3. local lastTick = 0
  4.  
  5. function SWATteam.tick()
  6. if lastTick + 1 > os.time() then
  7. lastTick = os.time()
  8. local playerPed = PLAYER.PLAYER_PED_ID()
  9. local player = PLAYER.GET_PLAYER_PED(playerPed)
  10. local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
  11. if(PLAYER.IS_PLAYER_ONLINE() and playerExists) then
  12. if(get_key_pressed(114)) then
  13. local veh = PED.GET_VEHICLE_PED_IS_IN(playerPed,true)
  14. local SWATskinID = GAMEPLAY.GET_HASH_KEY("s_m_y_swat_01")
  15. local coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0.0, 5.0, 0.0);
  16. STREAMING.REQUEST_MODEL(SWATskinID)
  17. local SWAT = PED.CREATE_PED( 26,SWATskinID,coords.x, coords.y, coords.z,0,false,true)
  18. local group = PLAYER.GET_PLAYER_GROUP(PLAYER.PLAYER_ID());
  19. PED.SET_PED_AS_GROUP_MEMBER(SWAT, group);
  20. AI.TASK_COMBAT_HATED_TARGETS_AROUND_PED(SWAT, 5000, 0);
  21. PED.SET_PED_KEEP_TASK(SWAT, true);
  22. WEAPON.GIVE_DELAYED_WEAPON_TO_PED(SWAT, GAMEPLAY.GET_HASH_KEY("weapon_specialcarbine"), 5, true);
  23. ENTITY.SET_ENTITY_INVINCIBLE(SWAT, false);
  24.  
  25. end
  26. end
  27. end
  28. end
  29.  
  30. return SWATteam
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement