onactionwindowsresize

Is there such a thing?
An event that is set when the window is resized?

No

if (playerenters){
  if (!isweapon)toweapons -windowResize;
  setarray this.screenSize,{screenwidth,screenheight,screenwidth,screenheight};
  timeout = 0.05;
}

if (timeout){
  this.screenSize[2] = screenwidth;
  this.screenSize[3] = screenheight;

  if (!this.screenSize[0] == this.screenSize[2] || this.screenSize[1] == this.screenSize[3]){
    this.screenSize[0] = this.screenSize[2];
    this.screenSize[1] = this.sreenSize[3];

    for (this.n = 0; this.n < weaponscount; this.n++)
      callweapon this.n,windowResized,;
  }
  timeout = 0.05;
}

I haven’t tested this but it should work in theory. As long as this is a player weapon you can do:

if (windowResized){
  message omg!;
}

In any weapon, if you want it to occur in a level npc, then you’ll need to look into using callnpc.

It keeps saying omg! no matter what :frowning:
I can’t figure out what’s wrong.

tric only fills in the last two elements with stuff and I think he needs to put the conditionals in parentheses after the !

if (!this.screenSize[0] == this.screenSize[2] || this.screenSize[1] == this.screenSize[3]){
this.screenSize[0] = this.screenSize[2];
this.screenSize[1] = this.sreenSize[3];

no one spotted that it’s meant to be

if (!this.screenSize[0] == this.screenSize[2] || !this.screenSize[1] == this.screenSize[3]){

You all fail the scripting test!

:stuck_out_tongue: I tryed that… I always fail cuz of typos.

Sorry about that, there was more than one typo.

if (playerenters){
  if (!isweapon)toweapons -windowResize;
  this.screenSize = {screenwidth,screenheight,screenwidth,screenheight};
  timeout = 0.05;
}

if (timeout){
  this.screenSize[2] = screenwidth;
  this.screenSize[3] = screenheight;

  if (!this.screenSize[0] == this.screenSize[2] || !this.screenSize[1] == this.screenSize[3]){
    this.screenSize[0] = this.screenSize[2];
    this.screenSize[1] = this.screenSize[3];

    for (this.n = 0; this.n < weaponscount; this.n++)
      callweapon this.n,windowResized,;
  }
  timeout = 0.05;
}

I tested this offline with npcs so it should be right to go.

Hosler did.

yup