Advertisement
DiazSRB

Untitled

Jan 8th, 2021
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <FCNPC>
  2.  
  3. new TestNPC;
  4.  
  5. hook OnGameModeInit()
  6. {
  7. TestNPC = FCNPC_Create("polismen");
  8. FCNPC_Spawn(TestNPC, 280, 1558.0605, -1739.4417, 13.5469);
  9. FCNPC_SetHealth(TestNPC, 150.0);
  10. FCNPC_SetWeapon(TestNPC, 24);
  11. FCNPC_SetAmmo(TestNPC, 50);
  12. }
  13.  
  14. public FCNPC_OnSpawn(npcid)
  15. {
  16. if(npcid == TestNPC) {
  17. FCNPC_SetHealth(TestNPC, 100.0);
  18. }
  19. }
  20. public FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart)
  21. {
  22. if(npcid == TestNPC) {
  23. FCNPC_AimAtPlayer(TestNPC, issuerid, true, -1, true, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  24. defer NPCStopShooting();
  25. }
  26. }
  27.  
  28. public FCNPC_OnDeath(npcid, killerid, reason)
  29. {
  30. if(npcid == TestNPC) {
  31. defer NPCRespawn();
  32. }
  33. }
  34.  
  35. timer NPCStopShooting[ 10000 ]()
  36. {
  37. FCNPC_StopAim(TestNPC);
  38. }
  39.  
  40. timer NPCRespawn[ 10000 ]()
  41. {
  42. FCNPC_Respawn(TestNPC);
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement