[CD3.55] help needed to check plz

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
[@bank]#SAY\\\[@THegoldstuff1]#ACTMov D1 %ARG(2) Mov A3 %ARG(1)#IFEqual A3 ""#ACTFormatStr "'%s',%s" Mov A8 %A9FormatStr "FLD_NAME='%s'" Mov A2 %A9WriteValueSql "TBL_Bank" %A2 "FLD_NAME,FLD_Gold" %A8goto @menu[@menu]#SAYWelcome to the {FCOLOR/10}Athena server{FCOLOR/12} Bank\{FCOLOR/3}{FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\The total amount of gold you can store\can NOT exceed {FCOLOR/1}2Billion{FCOLOR/12}!!\\\\\\[@AddGold]#SAY{FCOLOR/3}{FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\The total amount of gold you can store\can NOT exceed {FCOLOR/1}1Billion{FCOLOR/12}!!\How Much gold would you like to donate to your bank?\\[@@goldamount]#ACTMov D6 %INPUTSTRgoto @checkgold[@checkgold]#IFcheckgold %D6#ACTInc D1 %D6FormatStr "FLD_Username='%s'" %USERNAMEMov A8 %A9FormatStr "FLD_Gold='%s'" %D1ReadValueSql "TBL_Bank" %A9 "fld_gold" @goldcheckUPDATEVALUESQL "TBL_Bank" %A8 %A9take gold %D6#SAY{FCOLOR/10}{FCOLOR/10} now has {FCOLOR/11}{FCOLOR/10} gold in the bank.\\\#elsesayYou do not have Gold.\\\\\[@getstuff1]#IF#SAY{FCOLOR/6} {FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\How Much gold would you like to take out of your bank?\\\\[@@takethegold]#ACTMov D4 %INPUTSTRgoto @goldcheck[@goldcheck]#IFELARGE D1 %D4#ACTDec D1 %D4FormatStr "FLD_Username='%s'" %USERNAMEMov A8 %A9FormatStr "FLD_Gold='%s'" %D1UPDATEVALUESQL "TBL_Bank" %A8 %A9give gold %D4#SAY{FCOLOR/5} {FCOLOR/10} now has {FCOLOR/11}{FCOLOR/10} gold in the bank.\#ELSESAYYou are taking too much gold!\\\\\[@goldcheck]#sayYou Have In Bank\#elsesaynothing in bank\
 
Last edited:

Xplot

Dedicated Member
Dedicated Member
Mar 11, 2012
24
3
30
Do you mean that?

Code:
[@bank]
#SAY\\\
[@THegoldstuff1]
#ACT
Mov D1 %ARG(2) 
Mov A3 %ARG(1)

#IF
Equal A3 ""
#ACT
FormatStr "'%s',%s"
 Mov A8 %A9
FormatStr "FLD_NAME='%s'" 
Mov A2 %A9
WriteValueSql "TBL_Bank" %A2 "FLD_NAME,FLD_Gold" %A8
goto @menu

[@menu]
#SAY
Welcome to the {FCOLOR/10}Athena server{FCOLOR/12} Bank\
{FCOLOR/3}{FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\
The total amount of gold you can store\can NOT exceed {FCOLOR/1}2Billion{FCOLOR/12}!!\\\\\\

[@AddGold]
#SAY{FCOLOR/3}{FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\
The total amount of gold you can store\
can NOT exceed {FCOLOR/1}1Billion{FCOLOR/12}!!
\How Much gold would you like to donate to your bank?\\

[@@goldamount]
#ACT
Mov D6 %INPUTSTR
goto @checkgold

[@checkgold]
#IF
checkgold %D6
#ACT
Inc D1 %D6
FormatStr "FLD_Username='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_Gold='%s'" %D1
ReadValueSql "TBL_Bank" %A9 "fld_gold" @goldcheck
UPDATEVALUESQL "TBL_Bank" %A8 %A9
take gold %D6
#SAY
{FCOLOR/10}{FCOLOR/10} now has {FCOLOR/11}{FCOLOR/10} gold in the bank.\\\
#elsesay
You do not have Gold.\\\\\

[@getstuff1]
#IF
#SAY
{FCOLOR/6} {FCOLOR/12} has {FCOLOR/1}{FCOLOR/12} Gold.\
How Much gold would you like to take out of your bank?\\\\

[@@takethegold]
#ACT
Mov D4 %INPUTSTR
goto @goldcheck

[@goldcheck]
#IF
ELARGE D1 %D4
#ACT
Dec D1 %D4
FormatStr "FLD_Username='%s'" %USERNAMEMov A8 %A9
FormatStr "FLD_Gold='%s'" %D1
UPDATEVALUESQL "TBL_Bank" %A8 %A9
give gold %D4
#SAY
{FCOLOR/5} {FCOLOR/10} now has {FCOLOR/11}{FCOLOR/10} gold in the bank.\
#ELSESAY
You are taking too much gold!\\\\\

[@goldcheck]
#say
You Have In Bank\
#elsesay
nothing in bank\
 
Upvote 0

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
aye lol, wasnt posting as i wanted it to look like above.....it all looks good and is working via npc but it not saving to sql.........any advice on how to fix plz
 
Upvote 0

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
yes , with fld_username and fld_gold

---------- Post added at 09:55 PM ---------- Previous post was at 09:52 PM ----------

its sql side that its not saving too, i have tried deleting and remaking table and even tried adding fld_name instead of fld_username, but nothing.
 
Upvote 0