Guest User

Untitled

a guest
Mar 4th, 2012
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. // tal332255 - Tal Peretz סקריפט זה הוכן על ידי המתכנת
  2.  
  3. #include <a_samp>
  4. #include <OnPlayerShootPlayer>
  5. #pragma tabsize 0
  6.  
  7. #define orange 0xFF9900AA
  8.  
  9. new PlayerShoot[MAX_PLAYERS];
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("Survey By tal332255 - Tal Peretz");
  14. return 1;
  15. }
  16.  
  17. public OnPlayerDisconnect(playerid, reason)
  18. {
  19. PlayerShoot[playerid] = 0;
  20. SetPVarInt(playerid, "Headshotted", 0);
  21. return 1;
  22. }
  23.  
  24. public OnPlayerDeath(playerid, killerid, reason)
  25. {
  26.  
  27. if(GetPVarInt(playerid, "Headshotted") == 1)
  28. {
  29. new string[128];
  30. format(string, sizeof(string), "* וקיבלת $2000 {9B2E5E}%s{FF9900} עשית הד-שוט לשחקן *",GetName(playerid));
  31. SendClientMessage(killerid,orange, string);
  32. GivePlayerMoney(killerid, 2000);
  33. SetPVarInt(playerid, "Headshotted", 0);
  34. PlayerShoot[playerid] = 0;
  35. GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
  36. GameTextForPlayer(killerid, "~r~Headshot", 3000, 3);
  37. }
  38.  
  39. return 1;
  40. }
  41.  
  42. public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
  43. {
  44. PlayerShoot[Target] = Shooter;
  45. return 1;
  46. }
  47.  
  48. public OnPlayerUpdate(playerid)
  49. {
  50. new id = GetPlayerAnimationIndex(playerid);
  51. if(id == 1173 || id == 1175 || id == 1177 || id == 1178)
  52. {
  53. new weapon2 = GetPlayerWeapon(PlayerShoot[playerid]);
  54. if(weapon2 == 24 || weapon2 == 25 || weapon2 == 33 || weapon2 == 34)
  55. {
  56. SetPVarInt(playerid, "Headshotted", 1);
  57. SetPlayerHealth(playerid, 0);
  58. }
  59. }
  60. return 1;
  61. }
  62. ///////
  63.  
  64.  
  65. stock GetName(playerid){
  66. new Name[MAX_PLAYER_NAME];
  67. GetPlayerName(playerid,Name,sizeof(Name));
  68. return Name;}
  69.  
  70. stock GetDistanceFromPointToLine(&Float:distance, Float:line_vector_x, Float:line_vector_y, Float:line_vector_z, Float:line_x, Float:line_y, Float:line_z, Float:point_x, Float:point_y, Float:point_z)
  71. {
  72. static Float:output;
  73. crossp(line_vector_x, line_vector_y, line_vector_z, point_x - line_x, point_y - line_y, point_z - line_z, output);
  74. distance = output / floatsqroot ((line_vector_x * line_vector_x) + (line_vector_y * line_vector_y) + (line_vector_z * line_vector_z));
  75. return 0;
  76. }
  77.  
  78. stock crossp(Float:v1x, Float:v1y, Float:v1z, Float:v2x, Float:v2y, Float:v2z, &Float:output)
  79. {
  80. new
  81. Float:c1 = (v1y * v2z) - (v1z * v2y),
  82. Float:c2 = (v1z * v2x) - (v1x * v2z),
  83. Float:c3 = (v1x * v2y) - (v1y * v2x);
  84. output = floatsqroot ((c1 * c1) + (c2 * c2) + (c3 * c3));
  85. return 0;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment