The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't set item's value in game? (or via script)
Author Message
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #20
RE: Can't set item's value in game? (or via script)
Okay, starting the tests, the ARGN1 in @ItemSell isn't the 'amount of selling item'. It's the total amount of the item.
In @ItemBuy is okay.
I'm planning to check if the item have <TAG.VALUE>
If yes, open a gump for each item 'sold' and ask for confirmation of player, showing the 'tag.price' of the item and giving the correct money for the item.
Each opened dialog will be invisible while asking for confirmation.
If the player close the gump, the item appear again in the backpack.
If the player confirm the action, he get the money and the item is sent to npc vendor.
If the player disconnect, it will cancel all gumps, so don't apply the purchase.

But, I really need the ARGN1 in @ItemSell working to do it better.
Of course I can fix it using the total amount and creating buttons to choice how much amount the player want to sell.

For now is that.
Any idea is welcome.

I know its uggly and not shining... I just for tests, I hate code in notebooks... lazy too much...
This is just the base, the gump is socks but just to see how it will work.
I need know how to close the hardcoded sell gump too.

PHP Code:
ON=@ITEMSELL
SERV
.@,,1 Item Name: <ACT.NAME>
SERV.@,,1 Amount: <ARGN1>

IF <
ACT.dTAG.VALUE>
 
ACT.ATTR |= 090
 TAG
.<ACT>.ID <ACT.ID>
 
ACT.DIALOG D_ITEM_SELL
 ACT
.UPDATE
 
RETURN 1
ENDIF

[
DIALOG D_ITEM_SELL]
200,200
RESIZEPIC 0 0 9300 200 200
TILEPIC 20 20 
<ID>
DTEXT 20 40 1010 <NAME> <AMOUNT>

BUTTON 20 100 247 248 1 0 1

[DIALOG D_ITEM_SELL BUTTON]
ON=0
ATTR 0
UPDATE
SRC
.TAG.<UID>
SRC.SYSMESSAGE YOU CANCELED THE SALE
RETURN 1
ON
=1
SRC
.GOLD += <EVAL <AMOUNT>*<dTAG.VALUE>>
REMOVE
SRC
.SYSMESSAGE YOU CONFIRMED THE SALE <SRC.GOLD>
RETURN 


STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 09-04-2012 05:45 AM by Extreme.)
09-04-2012 05:19 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Can't set item's value in game? (or via script) - Extreme - 09-04-2012 05:19 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)