The basics of your script could look like:
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.on = false;
onTimeOut();
}
function onWeaponFired() {
if (this.on == false) { //I know there are better ways but I still prefer this one, can´t tell why
this.on = true;
disabledefmovement();
}
else if (this.on == true) {
this.on = false;
enabledefmovement(); //currently not sure if you can fire weapons while you are in disabledefmovement()
}
}
function onTimeOut() {
if (this.on == true) {
for (a = 0; a < 4; a++) {
if (keydown(a)) { //moving keys have been pressed
this.plane_x += vecx(a)*0.5; //normal players speed. change the *# to any number you want the speed to be
this.plane_y += vecy(a)*0.5; //same
this.plane_dir = k;
this.plane_ani = "YourAniNameHere"; //put in the flying gani name of your plane
}
else this.plane_ani = "YourAniNameHere"; //put in the idle gani of your plane
}
DrawPlane(); //starting the event DrawPlane
settimer(0.05);
}
}
function DrawPlane() {
with (findimg(1)) {
x = thiso.plane_x;
y = thiso.plane_y;
ani = thiso.plane_ani;
dir = thiso.plane_dir;
layer = 1;
}
}
Again couldn´t test it and just quick writed it so if there are any problems just tell me