PDA

View Full Version : Paintball Script Help


Grey_Mage
05-26-2001, 06:27 AM
I need someone to please tell me how to make a "refiller" type item for this paintball gun script...


if (this.init!=1) {
this.radius=0;
this.maxcount=30;
this.life=5;
this.arrowspeed=2;
this.arrowdamage=1;
setarray this.arrowx,this.maxcount+1;
setarray this.arrowy,this.maxcount+1;
setarray this.arrowdir,this.maxcount+1;
setarray this.arrowtime,this.maxcount+1;
setarray this.arrowact,this.maxcount+1;
this.init=1;
}
if (got_ammo) {
this.ammo=0;
unset got_ammo;
}
if (playertouchsme) {
setstring paint_ammo,10;
toweapons Red Paintball Gun;
timeout=.05;
}
if (weaponfired&&this.ammo=1) {
play item2.wav;
}

if(weaponfired&&this.ammo=0){
i = strtofloat(#s(paint_ammo)) - 1;
play fire.wav;
freezeplayer .4;
playersprite=33;
setstring paint_ammo,#v(i);
if (i == 0)
{
setstring paint_ammo,0;
this.ammo=1;
}
setbow wbow4.gif;
sleep .3;

if(playerdir==3){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==0){
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery-1;
}
if(playerdir==1){
this.arrowx[this.out]=playerx-1;
this.arrowy[this.out]=playery+1.5;
}
if(playerdir==2){
this.arrowx[this.out]=playerx+1.25;
this.arrowy[this.out]=playery+2;
}
this.arrowdir[this.out]=playerdir;
this.arrowact[this.out]=0;
this.out++;
timeout=.05;
}
if(timeout){
for(e=0;e<this.out;e++){
if(this.arrowact[e]==0){
if(this.arrowdir[e]==3){
this.arrowx[e]+=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==0){
this.arrowy[e]-=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==1){
this.arrowx[e]-=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];
}

if(this.arrowdir[e]==2){
this.arrowy[e]+=this.arrowspeed;

showimg e,firemateria.gif,this.arrowx[e],this.arrowy[e];

}

this.arrowtime[e]++;
if(onwall(this.arrowx[e],this.arrowy[e])){
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
this.arrowtime[e]=this.life*20;
}
}else{
this.arrowtime[e]=this.life*20;
}
for (c=0; c<compuscount; c++) {
if (abs(this.arrowx[e]-compus[c].x)<=2 &&
abs(this.arrowy[e]-(compus[c].y-0.5))<=2 &&
compus[c].mode!=3&&
compus[c].mode!=5){
hitcompu c,this.arrowdamage,this.arrowx[e]+0.5,this.arrowy[e]+0.5;
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
hideimg 103;
}
}
for (d=1; d<playerscount; d++) {
if (abs((this.arrowx[e]+0.7)-(players[d].x+2))<=1 &&
abs((this.arrowy[e]+0.5)-(players[d].y+2))<=1.5){
hitplayer d,this.arrowdamage,this.arrowx[e],this.arrowy[e];
showimg 103,firemateria.gif,this.arrowx[e],this.arrowy[e];
this.arrowact[e]=1;
hideimg 103;
}
}
if (this.arrowtime[e] >= (this.life*20)) {
hideimg e;
for (b=e; b<=this.out && b<20; b++) {
this.arrowx[b] = this.arrowx[b+1];
this.arrowy[b] = this.arrowy[b+1];
this.arrowdir[b] = this.arrowdir[b+1];
this.arrowact[b] = this.arrowact[b+1];
this.arrowtime[b] = this.arrowtime[b+1] - 1;
}
this.arrowx[this.out] = -1;
this.arrowy[this.out] = -1;
this.arrowdir[this.out] = -1;
this.arrowtime[this.out] = -1;
this.arrowact[this.out] = -1;
this.out--;
a--;
hideimg this.out;
hideimg 103;
}
}
timeout=.05;
}

Grey_Mage
05-26-2001, 08:40 AM
Anyone care to help me?
I could really use the help...

Grey_Mage
05-27-2001, 10:27 AM
PLEASE, if you can help me please do so! I would be VERRRY grateful...