Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom Qmenu (https://forums.graalonline.com/forums/showthread.php?t=68385)

Angel_Light 08-27-2006 07:19 PM

Custom Qmenu
 
I have made a custom qmenu and I need to know how to display all the player weapons, on Niromia every weapon img is 32 by 32 (pixels). So how do I display all the weapons with images.

xXziroXx 08-28-2006 05:17 PM

Make a loop go through all the players weapons, and display an image for each of them?

contiga 08-28-2006 07:43 PM

Quote:

Originally Posted by excaliber7388
Excelent :) I also plan to script one, I hope you don't mind me using this as a base :)

Ofcourse you can use that as base! Just change player.weapons to an array with weapons you actually want to draw. Something that could make a selection of weapons that you'd like to draw / not to draw:

PHP Code:

temp.wlist.clear();
temp.disabled = { "-""+"};
for ( 
iplayer.weapons) {
  for ( 
jtemp.disabled) {
    if ( !
i.name.startsj))
      
temp.wlist.add( { i.namei.image});
  }
}

for ( 
0temp.wlist.size(); ++) {
  
with findImg200 i)) {
    
image temp.wlisti][ 1];
    
start x + ( space_between_items_horizontal 32 * ( ammount_of_items_horizontal));
    
start y + ( space_between_items_vertical 32 intammount_of_items_horizontal));
    
layer 4;
  }


Good luck with it! If you have any questions, feel free to ask.

Angel_Light 08-29-2006 01:33 AM

Thank-you you two!

excaliber7388 08-29-2006 02:31 AM

Quote:

Originally Posted by contiga
For drawing players weapons use:
PHP Code:

for ( 0player.weapons.size(); ++) {
  
with findImg200 i)) {
    
image player.weaponsi].image;
    
start x + ( space_between_items_horizontal 32 * ( ammount_of_items_horizontal));
    
start y + ( space_between_items_vertical 32 intammount_of_items_horizontal));
    
layer 4;
  }


Change:
space_between_items_horizontal
space_between_items_vertical
ammount_of_items_horizontal
Into what you want that thing to be.

Excelent :) I also plan to script one, I hope you don't mind me using this as a base :)

contiga 08-29-2006 09:53 AM

Oh see my first post, I edited it instead of creating new one x-x

Rapidwolve 08-29-2006 03:05 PM

Quote:

Originally Posted by contiga
Oh see my first post, I edited it instead of creating new one x-x

Lol I was wondering wtf?

contiga 09-01-2006 08:39 PM

Oops, I just see I made a fault;
PHP Code:

this.wlist.clear();
temp.disabled = { "-""+"};
for ( 
iplayer.weapons) {
  for ( 
jtemp.disabled) {
    if ( !
i.name.startsj))
      
this.wlist.add( { i.namei.image});
  }
}

for ( 
0this.wlist.size(); ++) {
  
with findImg200 i)) {
    
image thiso.wlisti][ 1];
    
start x + ( space_between_items_horizontal 32 * ( ammount_of_items_horizontal));
    
start y + ( space_between_items_vertical 32 intammount_of_items_horizontal));
    
layer 4;
  }


What was wrong? I did temp.wlist, which isn't realy wrong, to make a list.. but it couldn't load within the with ( findImg( 200 + i)) { // stuff } part. This is an update, that should work.


All times are GMT +2. The time now is 10:50 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.