Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Weapon Scrolling (https://forums.graalonline.com/forums/showthread.php?t=134267441)

brokk 11-21-2012 09:33 PM

Weapon Scrolling
 
The best way I can explain what I am trying to do, is compare it to a hat system (Where the hat appears above your head, and you scroll though, and if you don't have the hat, it goes onto the next one)

I'm trying to avoid making an inventory so I am making a weapon system where you can scroll though your different weapons.
Every weapon is assigned a number.
For example, Katana = weapon 1.
So when you get it, clientr.weapon1 = true; so the client knows the player has it.

So lets say you have weapon1, 2, 3, 6.
How would I go about making a system that scrolls through 1, 2, and 3, but because there is no 4 or 5, it skips right to 6?

BlueMelon 11-21-2012 10:28 PM

Not sure how your item system looks, but by the looks of it:

PHP Code:

for (temp.0<= 6i++) {
    if ( 
player.clientr.(@ "weapon" temp.i) ) {
        
// Has weapon
    
}




All times are GMT +2. The time now is 02:11 AM.

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