RPG-Style click Q-Menu, image files are attached below:
if (playerenters) {
toweapons -QMenu;
if (isweapon) {
disableselectweapons;
timeout = 0.05;
}
}
if (keypressed) {
if (isweapon) {
disableselectweapons;
if (strtofloat(#p(0)) == 81) {
if (this.on == 0) {
this.on = -1;
}
setarray this.vis,weaponscount;
this.c = 0;
for (i=0;i<weaponscount;i++) {
if (startswith(-,#w(i))) {
} else {
this.vis[this.c] = i;
this.c++;
}
}
this.sp = 50;
this.rows = 4;
this.on = -this.on;
timeout = 0.05;
}
}
}
if (mousedown) {
if (isweapon) {
if (this.on == 1) {
for (i=0;i<this.c;i++) {
if (abs(mousescreenx - (screenwidth/2-155+this.sp/2+i*this.sp-(int(i/this.rows)*this.sp*this.rows))) < this.sp/2 && abs(mousescreeny - (screenheight/2-100+(int(i/this.rows)*this.sp))) < this.sp/2) {
this.selected = this.vis[i];
}
}
}
}
}
if (timeout) {
if (isweapon) {
seteffect 0,0,0,0;
for(i=-305;i<1000;i++) {
hideimg i;
}
if (this.on == 1) {
timeout = 0.05;
selectedweapon = this.selected;
i = 0;
for (i=0;i<this.c;i++) {
showimg 301+i,#W(this.vis[i]),screenwidth/2-145+i*this.sp-(int(i/this.rows)*this.sp*this.rows),screenheight/2-110+(int(i/this.rows)*this.sp);
changeimgvis 301+i,5;
if (abs(mousescreenx - (screenwidth/2-155+this.sp/2+i*this.sp-(int(i/this.rows)*this.sp*this.rows))) < this.sp/2 && abs(mousescreeny - (screenheight/2-100+(int(i/this.rows)*this.sp))) < this.sp/2) {
showtext -302,mousescreenx+16,mousescreeny,Arial,,#w(this.vis[i]);
}
}
changeimgvis -302,5;
changeimgzoom -302,0.5;
changeimgcolors -302,0,0,0,1;
showimg 300,qmenu_gui.png,screenwidth/2-158,screenheight/2-126;
changeimgvis 300,4;
showimg -300,#W(this.selected),screenwidth/2+95,screenheight/2-100;
showtext -301,screenwidth/2+77,screenheight/2-62,Arial,,Weapon: #w(this.selected);
changeimgzoom -301,0.5;
changeimgvis -300,5;
changeimgvis -301,5;
changeimgcolors -301,0,0,0,1;
seteffect 0,0,0,0.5;
}
}
}
Made this QMenu in a few minutes. If anybody wants it, look down.
Press Q to turn it on, lol, use left and right to scroll, press A,S,D, or Q to close the menu and confirm your selection.
if (playerenters) {
toweapons qmenu;
if (isweapon) {
disableselectweapons;
timeout = 0.05;
}
}
if (keypressed) {
disableselectweapons;
if (strtofloat(#p(0)) == 81) {
if (this.on == 0) {
this.on = -1;
}
this.on = -this.on;
}
}
if (timeout) {
timeout = 0.05;
seteffect 0,0,0,0;
enabledefmovement;
for(i=499;i<600;i++) {
hideimg(i);
}
if (this.on == 1) {
if (!keydown(3) && !keydown(1)) {
this.ad = 0;
}
if (keydown(1)) {
this.ad+=0.5;
this.sel+=1+this.ad;
}
if (keydown(3)) {
this.ad+=0.5;
this.sel-=1+this.ad;
}
if (this.sel <= 0) {
this.ad = 0;
this.sel = 0;
}
for (i=4;i<8;i++) {
if (keydown(i)) {
this.on = -1;
}
}
if (this.sel >= weaponscount*32) {
this.ad = 0;
this.sel = weaponscount*32;
}
seteffect 0,0,0,0.5;
disabledefmovement;
setani idle,;
for(i=0;i<weaponscount;i++) {
showimg 500+i,#W(i),screenwidth/2+i*32-this.sel,screenheight/2;
changeimgvis 500+i,4;
changeimgcolors 500+i,1,1,1,0.5;
if (abs(this.sel - i*32-16) < 17) {
selectedweapon = i;
showtext 499,screenwidth/2+(strlen(#w(i))*2),screenheight/2+32,Arial,Center,#w(i);
changeimgzoom 499,0.5;
changeimgvis 499,4;
changeimgcolors 500+i,1,1,1,1;
}
}
}
}