Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GRAWP001
- REALNAME Guns/TServerFlamer
- IMAGE bcalarmclock.png
- SCRIPT
- join weapongun;
- //#CLIENTSIDE
- if (created) {
- //Gun Statistics Variables
- this.gun_projectile = 139; // see db-projectiles
- this.gun_ammolimit = 9999;
- this.gun_damage = 150;
- // this.gun_50; //Max ammo to load
- this.gun_maxbullets = 1; //Bullets to fire
- this.gun_maxammo = 250; //Max ammo to load
- this.gun_fireammo = 1; //Ammo to deduct
- this.gun_repeatfire = true; //Uzi type mechanism
- this.gun_spread = 0.05; //Bullet Spread
- //this.gun_zangle = {.3, .07}; //Range
- //this.gun_power = {1.1, 1}; //Speed
- this.gun_customfire = true;
- this.player_freezefire = {0,0}; //Freeze/Sleep
- this.player_freezereload = {0.03,0.25};
- this.gunitem = 757;
- //Graphical/System Variables
- setstring this.weapon_name,Guns/TServerFlamer;
- setstring this.weapon_sysname,Uzi; //#e(5,-1,#w) for Guns/Weapon items OR the actual flag
- setstring this.weapon_sysname2,Uzi;
- //setstring this.weapon_opposite,Flame Shells;
- setstring this.ani_idle,era_flamethrower-idle;
- setstring this.ani_walk,era_flamethrower-walk;
- setstring this.ani_fire,era_flamethrower-fire;
- setstring this.ani_reload,era_flamethrower-idle;
- setstring this.ani_bullet,era_tserverflame;
- }
- function DataIn2() {
- //Bullet positioning
- if (playerdir==0) {this.x1=-1.2;this.y1=0;}
- if (playerdir==1) {this.x1=1.75;this.y1=-2;}
- // if (playerdir==2) {this.x1=random(-.4,-1)+.65;this.y1=-.5;}
- if (playerdir==2) {this.x1=-.75;this.y1=-4.8;}
- if (playerdir==3) {this.x1=-3;this.y1=-1.5;}
- }
- function DataIn() {
- if (strafedir>=0) playerdir=strafedir;
- this.x1=0;this.y1=0;
- this.angle = playerdir==3?0:(playerdir+1)*1.57;
- this.angle += this.dirangle + random(-this.gun_spread,this.gun_spread);
- DataIn2();
- }
- function Fire() {
- if (strtofloat(#I(clientr.itemc#v(this.gunitem),0))>0) {
- if (strtofloat(#s(clientr.loadedammo_#s(this.weapon_sysname2)))>0 && this.fired == false) {
- this.temp = strtofloat(#s(clientr.loadedammo_#s(this.weapon_sysname2))) - this.gun_fireammo;
- if (this.temp>this.gun_ammolimit) this.temp = this.gun_ammolimit;
- triggeraction 0,0,serverside,#s(this.weapon_name),loadcheck,#s(this.weapon_sysname2),#v(this.temp);
- setani #s(this.ani_fire),;
- for (i=0;i<this.gun_maxbullets;i++) {
- DataIn();
- if (this.gun_zangle[1]>0) this.zangle = this.gun_zangle[0] + random(-this.gun_zangle[1],this.gun_zangle[1]);
- if (this.gun_power[1]>0) this.power = this.gun_power[0] + random(-this.gun_zangle[1],this.gun_power[1]);
- temp.proj = new CustomProjectile();
- proj.speed = 0.5;
- proj.x = player.x - this.x1;
- proj.y = player.y - this.y1 - 0.5;
- proj.angle = this.angle;// + this.random;
- proj.ani = this.ani_bullet;
- proj.ignorewalls = true;
- proj.shoot();
- setshootparams #v(this.gun_projectile);
- setshootparams("heart", player.account);
- 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;
- temp.proj = new CustomProjectile();
- temp.proj.x = player.x-this.x1; // starting location
- temp.proj.y = player.y-this.y1-0.5;
- temp.proj.speed = 1; // in tiles per frame
- temp.proj.range = 15; // in tiles
- temp.proj.angle = this.angle+this.random;
- temp.proj.zangle = this.zangle;
- temp.proj.gravity = this.power;
- temp.proj.ani = this.ani_bullet;
- temp.proj.params = {player.guild,150,1};
- temp.proj.ignorewalls = true;
- temp.proj.hideBulletEffect = true;
- temp.proj.shoot();
- }
- //doRecoil();
- this.fired = true;
- //playerfreezesecs = this.player_freezefire[0];
- this.fired = false;
- }
- }
- }
- function doRecoil()
- {
- //this.CheckPlayerPos(player.dir);
- if (this.onwallcheck == true)
- return;
- temp.recoil = 2 / 16;
- temp.recoil = .4;
- switch(player.dir)
- {
- case 0:
- temp.position = {player.x, player.y + temp.recoil};
- break;
- case 1:
- temp.position = {player.x + temp.recoil, player.y};
- break;
- case 2:
- temp.position = {player.x, player.y - temp.recoil};
- break;
- case 3:
- temp.position = {player.x - temp.recoil, player.y};
- break;
- }
- for (temp.k = 0; k < temp.recoil * 16; k++) {
- for (temp.i = 0; i < 4; i++) {
- if (player.dir == i) {
- 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)) {
- player.x = temp.position[0];
- player.y = temp.position[1];
- }
- }
- }
- }
- }
- SCRIPTEND
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement