Ok, here some more code; The game is german, so the variables are German too, I tried to commend them that you can understand it. This is the whole fire-function:
function feuer(pox,poy)
{
var aufgenommen=0; //create the variable "aufgenommen"
if(feuani==-2)
{animationfeuer();
feuani=0;} //animate the fire
PANEL* feua = pan_create("pos_x=0;pos_y=0;flags=OVERLAY | VISIBLE;",8); //create the fire
pan_setwindow(feua,0,0,0,30,18,feu_bmp,feuani,0); //animate the fire with window
my = ent_create("gegum.mdl",nullvector,NULL); //give the fire an entity
my.skill3=50; //live of the fire
my.flags=INVISIBLE; //set the Entity on invisible
my.skill6=2;
while(my.skill3>=0) //repead while the life of the fire is bigger than zero
{
vec_set(my.x,vector(feua.pos_x+15*my.skill3/50,feua.pos_y+9*my.skill3/50,0)); //set the position of the entity on the position of the fire-panel
feua.pos_x=stage_a.pos_x+pox-15*my.skill3/50;
feua.pos_y=stage_a.pos_y+poy-9*my.skill3/50; //position of the fire on the map named "stage_a"
feua.scale_x=my.skill3/50;
feua.scale_y=my.skill3/50; //scale the fire proportional with his live
if(my.skill3<50)
my.skill3+=1*time_ste; //rebuild the fire from time to time
wait(1);
}
media_tune(snd_play(zisch_snd,NULL,100),100,150,100); //make a sound
ptr_remove(feua); //delete the fire-panel
ent_remove(my); //delete the entity from the fire
feuerzahl+=1; //count the firenumber
}
And there the whole code for the water:
function distanz(pox, poy) //This function is triggered by the player
{
attart = bmap_create("att1.bmp"); //create the bitmap
PANEL* flobj = pan_create("pos_x=0;pos_y=0;bmap=attart;flags=OVERLAY | VISIBLE;",10); //create the water-panel
var posl[2];
posl[0]=pox;
posl[1]=poy; //set the positions
while(flobj.skill_x<100&&flobj.skill_y==0) //repeat until it finds a target or the time is off
{
flobj.pos_x=stage_a.pos_x+posl[0]-4.5;
flobj.pos_y=stage_a.pos_y+posl[1]-4.5; //set the positions on the map
flobj.skill_x+=4*time_step; //count the skill_x of the panel
posl[1]-=16*time_step; //move the water
if(vec_dist(vector(pox,poy,0),vector(posl[0],posl[1],0))>18) //if the water is away from this one who shots
{c_scan(vector(flobj.pos_x+4.5,flobj.pos_y+4.5,0),my.pan,vector(360,0,9),NULL);} //look for targets
if(you) //if there's a target
{
if(vec_dist(you.x,vector(stage_a.pos_x+posl[0]-4.5,stage_a.pos_y+posl[1]-4.5,0))<=9) //if the target near you
{
effectiv = 30;
you.skill3-=effectiv; //damage the target
if(flobj.skill_y==0)
{
snd_play(platsch_snd,NULL,effectiv*3); //make a sound
flobj.skill_y=1;}
}}
wait(1);
}
pan_remove(flobj); //remove the water
}
And last, the function of the scenario (cutted):
function part_3()
{
.
.
.
feuer(200,850);
feuer(130,920);
feuer(240,1000);
feuer(400,980);
feuer(270,920); //create the fires
.
.
.
dialog("Lösche alle Feuer!"); //function for a dialog
.
.
.
beep();
var i = 0;
while(feuerzahl<5) //the test-loop from ottawa
{
for (i=1; i<5; i++)
{
test = i; //test is a value, who I see on a digit
beep();wait(-2);
} //beep every second
}
beep();beep();beep();beep(); //test, if the function continues
.
.
.
}
The whole code works, only this problem with the firenumber don't do what it should do. Hope, there are enough informations.