- Aug 4, 2003
- 256
- 7
- 114
Made this a while ago, its mostly an SQL based script that allows a guildbank to be created for each individual guild, guildleader can withdraw money out, and guildmembers can put money into their guild bank. This is just a basic script for those learning SQL to get started with
you will need to make a new table named "TBL_GUILDBANK"
and 2 fields
"FLD_GUILD" set this to varchar
"FLD_GOLD" set this to varchar
before proceeding.. its advisable that you have a little background on how to add new tables and databases in SQL, which I won't be covering with this
let me no if you have questions
you will need to make a new table named "TBL_GUILDBANK"
and 2 fields
"FLD_GUILD" set this to varchar
"FLD_GOLD" set this to varchar
before proceeding.. its advisable that you have a little background on how to add new tables and databases in SQL, which I won't be covering with this
let me no if you have questions
Code:
begin
[@main]
#IF
HasGuild
#ACT
FormatStr "FLD_GUILD='%s'" %GUILDNAME
ReadValueSql "TBL_GUILDBANK" %A9 "FLD_GUILD,FLD_GOLD" [@THegoldstuff1]
#ELSESAY
You dont have a guild.\
[@THegoldstuff1()]
#ACT
Mov D1 %ARG(2) ;Retrieves gold amount
Mov A3 %ARG(1) ;Retrieve guild name
#IF
Equal A3 "" ;If there is no guild listed under this name it makes an entry below
#ACT
FormatStr "'%s',%s" %GUILDNAME 0
Mov A8 %A9
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A2 %A9
WriteValueSql "TBL_GUILDBANK" %A2 "FLD_GUILD,FLD_GOLD" %A8
goto @menu
#ELSEACT
goto @menu
[@menu]
#SAY
Welcome to the {FCOLOR/10}RNDPRO{FCOLOR/12} Guild Bank\
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.\
You cannot reconvert your famepoints to RNDPro points.\
<[ Donate Money to Bank ]/@AddGold>\
<[ Retreive Money from Bank ]/@getstuff1>\
<[ Exit ]/@exit>\\\
[@finallyadd]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@goldamount>
[@@goldamount]
#ACT
Mov D6 %INPUTSTR
goto @checkgold
[@checkgold]
#IF
checkgold %D6 ;Does goldcheck for amount you entered
#ACT
Inc D1 %D6 ;Adds your gold to the current gold amount in bank
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_GOLD='%s'" %D1
UPDATEVALUESQL "TBL_GUILDBANK" %A8 %A9
take gold %D6
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D2)>{FCOLOR/10} gold in the bank.\
<[ Exit ]/@exit>\\\
[@getstuff1]
#IF
IsGuildMaster
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to take out of your guild bank?\
<Amount of Gold/@@takethegold>
[@@takethegold]
#ACT
Mov D4 %INPUTSTR
goto @goldcheck
[@goldcheck]
#IF
ELARGE D1 %D4 ;If D1, which is the guildbank gold is larger than the amount you want to take out, it will allow it
#ACT
Dec D1 %D4
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_GOLD='%s'" %D1
UPDATEVALUESQL "TBL_GUILDBANK" %A8 %A9
give gold %D4
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D1)>{FCOLOR/10} gold in the bank.\
#ELSESAY
You are taking too much gold!\
Last edited: