ID:270297
![]() Mar 3 2006, 4:24 pm
|
|
Ok i've been messing with a browser shop for about a day or 2 now but i cant seem to make it to were i can have Class requirements and such how would i go about doing this to were only a certain class see the weapons that they can buy in the table that shows the weapons.
|
![]() Mar 3 2006, 4:50 pm
|
|
Maybe make a list variable and leave it empty to start. Then make another list for each class with the items they can buy. Then when a player uses the shop, check for their class, and add to the empty list the items in the list that coresponds with the players class. Then, when they choose to buy, show them the items in the list with the newly added items and go from there.
|
Glad to help.
It's really simple when you do it and should prove effective. Here's a quick snippet on how it would look. mob/Shopkeeper Just a quick snippet. Probably made a mistake somewhere, but its just a really basic example. Correct if you please. |
You really don't have to do this, as you can go around it with the way the shop is designed. Keep several variables for pages that contain lists of items classes can buy, then display the appropriate page after checking the class of the player who is shopping and in each page provide links to each other class's page. Realistically you would allow a player to buy anything regardless if it goes with their class or not, though you would warn the player before buying that they can't use/wear/equip that item with their current class.
|