Nope still doesent work i cant find the right comand to read sql and then check if the username is there
Heres what i have
[@Main]
#SAY
Hey {FCOLOR/2}<$USERNAME>{FCOLOR/0},
\
Have you voted? if you have you\
will be eligible for a reward\
< [Check for reward]/@Check>\
[@check]
#SAY
Please Wait a Second....\
#ACT
got
o @checking
[@checking]
#ACT
FormatStr "FLD_USERNAME='%s'" %USERNAME
ReadValueSql "TBL_VOTE" %A9 "FLD_USERNAME"
- i want it to check if the username exist in the database and then goto the next stage
This is just looking on tbl_vote for the username but I suggest you have a 3rd column being a yes/no column or add a column to the character table and interrogate that instead to see if the answer is yes/no 1/0 (whatever you choose to use).
What I would do - add a column to character_tbl called voted, values being 1 (voted) or 0 (not voted) and then
#ACT
FormatStr "FLD_USERNAME='%s'" %USERNAME
ReadValueSql "TBL_VOTE" %A9 "fld_voted" @votecheck
[@votecheck()]
#act
mov D1 %arg(1)
this will make the value in D1 = 0 or 1 which you can interrogate and use for the rest of the script.
[@next1]
#SAY
We have found your Username!\
\
<[ Collect Junes Reward]/@Reward>\
\
#ELSESAY
Sorry we did not find your\
username!\