Advertisement
IshSoul

tserver flame

Aug 21st, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. GRAWP001
  2. REALNAME Guns/TServerFlamer
  3. IMAGE bcalarmclock.png
  4. SCRIPT
  5. join weapongun;
  6. //#CLIENTSIDE
  7. if (created) {
  8.  
  9. //Gun Statistics Variables
  10. this.gun_projectile = 139; // see db-projectiles
  11. this.gun_ammolimit = 9999;
  12. this.gun_damage = 150;
  13. // this.gun_50; //Max ammo to load
  14. this.gun_maxbullets = 1; //Bullets to fire
  15. this.gun_maxammo = 250; //Max ammo to load
  16. this.gun_fireammo = 1; //Ammo to deduct
  17. this.gun_repeatfire = true; //Uzi type mechanism
  18. this.gun_spread = 0.05; //Bullet Spread
  19. //this.gun_zangle = {.3, .07}; //Range
  20. //this.gun_power = {1.1, 1}; //Speed
  21. this.gun_customfire = true;
  22. this.player_freezefire = {0,0}; //Freeze/Sleep
  23. this.player_freezereload = {0.03,0.25};
  24. this.gunitem = 757;
  25.  
  26. //Graphical/System Variables
  27. setstring this.weapon_name,Guns/TServerFlamer;
  28. setstring this.weapon_sysname,Uzi; //#e(5,-1,#w) for Guns/Weapon items OR the actual flag
  29. setstring this.weapon_sysname2,Uzi;
  30. //setstring this.weapon_opposite,Flame Shells;
  31. setstring this.ani_idle,era_flamethrower-idle;
  32. setstring this.ani_walk,era_flamethrower-walk;
  33. setstring this.ani_fire,era_flamethrower-fire;
  34. setstring this.ani_reload,era_flamethrower-idle;
  35. setstring this.ani_bullet,era_tserverflame;
  36. }
  37.  
  38. function DataIn2() {
  39. //Bullet positioning
  40. if (playerdir==0) {this.x1=-1.2;this.y1=0;}
  41. if (playerdir==1) {this.x1=1.75;this.y1=-2;}
  42. // if (playerdir==2) {this.x1=random(-.4,-1)+.65;this.y1=-.5;}
  43. if (playerdir==2) {this.x1=-.75;this.y1=-4.8;}
  44. if (playerdir==3) {this.x1=-3;this.y1=-1.5;}
  45. }
  46.  
  47. function DataIn() {
  48. if (strafedir>=0) playerdir=strafedir;
  49. this.x1=0;this.y1=0;
  50. this.angle = playerdir==3?0:(playerdir+1)*1.57;
  51. this.angle += this.dirangle + random(-this.gun_spread,this.gun_spread);
  52. DataIn2();
  53. }
  54.  
  55. function Fire() {
  56. if (strtofloat(#I(clientr.itemc#v(this.gunitem),0))>0) {
  57. if (strtofloat(#s(clientr.loadedammo_#s(this.weapon_sysname2)))>0 && this.fired == false) {
  58. this.temp = strtofloat(#s(clientr.loadedammo_#s(this.weapon_sysname2))) - this.gun_fireammo;
  59. if (this.temp>this.gun_ammolimit) this.temp = this.gun_ammolimit;
  60. triggeraction 0,0,serverside,#s(this.weapon_name),loadcheck,#s(this.weapon_sysname2),#v(this.temp);
  61. setani #s(this.ani_fire),;
  62.  
  63. for (i=0;i<this.gun_maxbullets;i++) {
  64. DataIn();
  65. if (this.gun_zangle[1]>0) this.zangle = this.gun_zangle[0] + random(-this.gun_zangle[1],this.gun_zangle[1]);
  66. if (this.gun_power[1]>0) this.power = this.gun_power[0] + random(-this.gun_zangle[1],this.gun_power[1]);
  67. temp.proj = new CustomProjectile();
  68.  
  69. proj.speed = 0.5;
  70.  
  71. proj.x = player.x - this.x1;
  72. proj.y = player.y - this.y1 - 0.5;
  73. proj.angle = this.angle;// + this.random;
  74. proj.ani = this.ani_bullet;
  75.  
  76. proj.ignorewalls = true;
  77.  
  78. proj.shoot();
  79.  
  80. setshootparams #v(this.gun_projectile);
  81. setshootparams("heart", player.account);
  82. shoot playerx-this.x1,playery-this.y1-0.5,0,this.angle+this.random,this.zangle,this.power,#s(this.ani_bullet),chrisz_boomerang.png;
  83.  
  84.  
  85.  
  86.  
  87. temp.proj = new CustomProjectile();
  88. temp.proj.x = player.x-this.x1; // starting location
  89. temp.proj.y = player.y-this.y1-0.5;
  90. temp.proj.speed = 1; // in tiles per frame
  91. temp.proj.range = 15; // in tiles
  92. temp.proj.angle = this.angle+this.random;
  93. temp.proj.zangle = this.zangle;
  94. temp.proj.gravity = this.power;
  95. temp.proj.ani = this.ani_bullet;
  96. temp.proj.params = {player.guild,150,1};
  97. temp.proj.ignorewalls = true;
  98. temp.proj.hideBulletEffect = true;
  99.  
  100. temp.proj.shoot();
  101.  
  102.  
  103. }
  104.  
  105. //doRecoil();
  106. this.fired = true;
  107. //playerfreezesecs = this.player_freezefire[0];
  108. this.fired = false;
  109. }
  110. }
  111. }
  112. function doRecoil()
  113. {
  114. //this.CheckPlayerPos(player.dir);
  115. if (this.onwallcheck == true)
  116. return;
  117. temp.recoil = 2 / 16;
  118. temp.recoil = .4;
  119. switch(player.dir)
  120. {
  121. case 0:
  122. temp.position = {player.x, player.y + temp.recoil};
  123. break;
  124. case 1:
  125. temp.position = {player.x + temp.recoil, player.y};
  126. break;
  127. case 2:
  128. temp.position = {player.x, player.y - temp.recoil};
  129. break;
  130. case 3:
  131. temp.position = {player.x - temp.recoil, player.y};
  132. break;
  133. }
  134.  
  135. for (temp.k = 0; k < temp.recoil * 16; k++) {
  136. for (temp.i = 0; i < 4; i++) {
  137. if (player.dir == i) {
  138. if (!onwall2(player.x + 1.5 - vecx(player.dir) * 33 / 32 - abs(vecy(player.dir)) - (vecx(player.dir) == 1 ? 1 / 32 : 0), player.y + 2 - abs(vecx(player.dir)) - vecy(player.dir) * 33 / 32 - (vecy(player.dir) == 1 ? 1 / 32 : 0), 1 / 16 + abs(vecy(player.dir)) * 31 / 16, 1 / 16 + abs(vecx(player.dir)) * 31 / 16)) {
  139. player.x = temp.position[0];
  140. player.y = temp.position[1];
  141. }
  142. }
  143. }
  144. }
  145.  
  146. }
  147. SCRIPTEND
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement