![]() |
Script: Shop system
Once again in the interest of education, here's my shop system. It's broken into several parts, so make sure to read the instructions carefully!
Now, of course you can modify the script to make it match your own setup, however, here's how it works in my configuration. It also works using gralats by default; you'll have to change it in order to use custom money. You'll need to update the shop weapon so that it adds the item to the player matching your own system. Also, you'll want to make sure that the seteffect fade doesn't interfere with your daynight, and finally, note that the weapon has a "Debit" option. This was for my setup on Rudora so that you could pay straight from your bank account. Either match it to your own bank system or just rip it out. The system will depend upon three database NPCs, two classes and one weapon. Start by making the Database NPCs;
You'll need to populate the NPCs with some data. Let's start with DB_Items; put the following script in DB_Items: PHP Code:
PHP Code:
Each shop level requires one shopcontrol class. This puts the level's base name into a level variable, and displays the shop's funds and name. Put this somewhere nice-looking. Just do something like this: PHP Code:
PHP Code:
That's about it, really. Once you upload the shop, it should work. You should also be able to specify a name for the shop inside DB_Shops' flag list once it's uploaded. Enjoy. Shop item class: PHP Code:
PHP Code:
PHP Code:
|
Sexy ;o
|
such a simple script to come from you, skyld! ;)
helpful though, way to go ;o |
Nifty..
|
What do you mean by ActionWeapon? in DB_Items? And what exactly do I put in DB_Shops?
|
ActionWeapon is most likely the actual Weapon the item uses to execute stuff.
I myself prefer to make certain public functions that are always executed in the weapon by the Mudlib. (mud_onPickUp(), mud_onEquip(), mud_onActivate(), mud_onUnEquip(), mud_onDrop()) It works nicely and Oblivion is a good source of ideas. |
I'm entirely sure but okay, still having problems with it though.
|
Resurrecting an old post. This is a good resource for some of us still, but Angel_Light's old question is mine.
So ActionWeapon is the -Shop weapon? and how do you set up DB_Shops? |
Quote:
Quote:
|
Well on here it just says make a DB called DB_Shops, and add a shop name in the flags.
doesnt tell what format, var to use if any, how to name the shops, nothing that i saw. the block.png sample item isnt even showing up for me either, and i followed all the directions. |
Quote:
PHP Code:
|
in the flags i have
this.armageddon-shop1.nw_name = "SHOP 1" also tried w/o .nw in the level name, w/o _name although its obviously required. its not showing up. can't buy anything either. Was also wondering, how would you add it to add player.bombs instead of a weapon? is typing that in where the ActionWeapon is sufficient? |
Quote:
Quote:
|
Quote:
|
Quote:
PHP Code:
So for all to come, add DB_Shops, and put that in it for each shop. Ex: PHP Code:
|
Just a note, if you're using the - character in a variable name, it will only work in instances like this:
PHP Code:
PHP Code:
|
| All times are GMT +2. The time now is 05:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.