Advertisement
4FunPlayin

Untitled

Oct 4th, 2011
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. doRaygun()
  2. {
  3. self endon("disconnect");
  4. self endon("death");
  5. self endon("game_ended");
  6.  
  7. self.textRayGunVal = spawnstruct();
  8. self.textRayGunVal = self createFontString( "default", 2.0 );
  9. self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
  10. self thread zmod\mp\_OtherFunctions::DestroyOnDeath(self.textRayGunVal);
  11. texta = spawnstruct();
  12. texta.text = "^1to far";
  13. for(self.ammoclipray = 120; self.ammoclipray > -1; self.ammoclipray--)
  14. {
  15. self waittill("weapon_fired");
  16. iWeap = self GetCurrentWeapon();
  17. if(iWeap == "pp2000_silencer_mp")
  18. {
  19. startB = GetCursorPos();
  20. RadiusDamage( startB, 101, 520, 507, self );
  21. startA = self getTagOrigin("tag_weapon_left");
  22. xD = distance(startA, startB);
  23. //We will have to do a limit of range, or else error 'no free dobjs'
  24. if(xD < 855)
  25. {
  26. pointe = roundUp(xD/13.5);
  27. self.textRayGunVal setValue(self.ammoclipray);
  28. self.textRayGunVal.color = (0,1,0);
  29. CX = startA[0] - startB[0];
  30. CY = startA[1] - startB[1];
  31. CZ = startA[2] - startB[2];
  32.  
  33. XA = CX/pointe;
  34. YA = CY/pointe;
  35. ZA = CZ/pointe;
  36. self.argRGun = -1;
  37. Temp = VectorToAngles(startA - startB);
  38. BA = (Temp[2], Temp[1] + 90, Temp[0]);
  39. //self.playingfxatm = playfx(level.spawnGlow["enemy"], startB);
  40. for(b = pointe; b > -1; b--)
  41. {
  42. self.pointRGW[self.argRGun] = spawn( "script_model", (startB + ((XA, YA, ZA) * b)) );
  43. self.pointRGW[self.argRGun] setModel("projectile_m67fraggrenade_bombsquad");
  44. self.pointRGW[self.argRGun].angles = BA;
  45. self thread removeRayGunShotEffect(self.pointRGW[self.argRGun]);
  46. }
  47. } else {
  48. self iPrintLnBold(texta.text);
  49. }
  50. }
  51. if(self.ammoclipray == 0)
  52. {
  53. self.textRayGunVal.color = (1,0,0);
  54. }
  55. }
  56. }
  57.  
  58. removeRayGunShotEffect(DObj)
  59. {
  60. wait 0.3;
  61. DObj delete();
  62. }
  63.  
  64. GetCursorPos()
  65. {
  66. forward = self getTagOrigin("tag_eye");
  67. end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
  68. location = BulletTrace( forward, end, 0, self)[ "position" ];
  69. return location;
  70. }
  71.  
  72. vector_scal(vec, scale)
  73. {
  74. vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
  75. return vec;
  76. }
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement