shourya90

Untitled

Apr 24th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public FCNPC_OnTakeDamage(npcid, issuerid, Float:amount, weaponid, bodypart)
  2. {
  3.  
  4. for(new i = 0; i < MAX_CITIZIENS; i++)
  5. {
  6.  
  7. if(!NpcInfo[i][NpcInMission])
  8. {
  9. SendClientMessage(issuerid, -1, "2");
  10. new str[128];
  11. format(str, 128, "%p\n{2aff00}%s", NpcInfo[i][npcsid], GetNpcHealthStatus(NpcInfo[i][npcsid]));
  12. UpdateDynamic3DTextLabelText(NpcInfo[i][ncpnames], -1, str);
  13. new Float:x,Float:y,Float:z;
  14. FCNPC_GetPosition(NpcInfo[i][npcsid], x, y, z);
  15. if(!FCNPC_IsAiming(NpcInfo[i][npcsid]))
  16. {
  17. SendClientMessageToAll(-1, "aim");
  18. if(!NpcInfo[i][checkDamage])
  19. {
  20. SendClientMessageToAll(-1, "famage");
  21. if(IsPlayerInRangeOfPoint(issuerid, 20, x,y,z))
  22. {
  23. SendClientMessageToAll(-1, "range");
  24. FCNPC_ClearAnimations(NpcInfo[i][npcsid]);
  25.  
  26. FCNPC_PausePlayingNode(NpcInfo[i][npcsid]);
  27. FCNPC_AimAtPlayer(NpcInfo[i][npcsid], issuerid, true);
  28. NpcInfo[i][checkDamage] = true;
  29. if(weaponid <=7)
  30. {
  31. if(FCNPC_GetSkin(NpcInfo[i][npcsid]) < 300)
  32. {
  33.  
  34. giveaimMelee(NpcInfo[i][npcsid], issuerid);
  35. }
  36. else
  37. {
  38. defer giveaim[500](NpcInfo[i][npcsid], issuerid);
  39. }
  40. }
  41. else
  42. {
  43. defer giveaim[500](NpcInfo[i][npcsid], issuerid);
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50.  
  51. return 1;
  52. }
Add Comment
Please, Sign In to add comment