[CD3.55] SQL Script Help

astral

Dedicated Member
Dedicated Member
Dec 14, 2012
109
3
45
Poland
Hi. I need help !
What to change:
Code:
[@BRDUSZA]
#IF
RANDOM 5
#ACT
eventmsg [grobal] "<$USERNAME>  zdobyl dusze Bellatora!" 10026
FormatStr "FLD_ChARACTER='%s'" %USERNAME
ReadValueSql  "TBL_Reputacja"  %A9  "FLD_POINT,FLD_CHARACTER"  [@Point_Add111]
[@Point_Add111()]
 #IF
 #ACT
   mov    D1      %ARG(1)
   mov    A0      %ARG(2)
 #IF
   Equal  A0   ""
 #IF


 #ACT


   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   mov   A8       %A9
   INC   D1       1
   mov   D8       %D1
   FormatStr "FLD_POINT='%s'" %D8
   UPDATEVALUESQL "TBL_Reputacja" %A8 %A9

To subtract 1 point instead of adding?
I change INC D1 1 on Dec D1 not work!

sorry for my English
 

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
Code:
FormatStr "FLD_CHARACTER='%s'" %USERNAME
   Mov   A8     %A9
   Dec   D2     1
   Mov   D4     %D2
   FormatStr "FLD_INTEGRAL='%s'" %D4
   UPDATEVALUESQL "TBL_INTEGRAL" %A8 %A9

I do exactly the same in one of my Integral scripts (as above) and I know this works, so if there is an error, it is not with the script.
 
Upvote 0

astral

Dedicated Member
Dedicated Member
Dec 14, 2012
109
3
45
Poland
Code:
[@trade]#SAY
<Trade 1x Soul for 1x Weskel/@weksel>


[@weksel]
#ACT
FormatStr "FLD_ChARACTER='%s'" %USERNAME
ReadValueSql  "TBL_Reputacja"  %A9  "FLD_POINT,FLD_CHARACTER"  [@Point_DELL]
[@Point_DELL()]
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
Mov   A8     %A9
Dec   D2     1
Mov   D4     %D2
FormatStr "FLD_Point='%s'" %D4
UPDATEVALUESQL "TBL_Reputacja" %A8 %A9

I had 1 PKT when I used the option and exchange it on a bill instead of taking 1 point it took -17

SCREEN0002.jpg
SCREEN0005.jpg
 
Upvote 0

Josiko

LOMCN Veteran
Veteran
Loyal Member
Apr 4, 2010
428
8
44
Spain
Hi guy, its the fix.

[@weksel]
#ACT
FormatStr "FLD_ChARACTER='%s'" %USERNAME
ReadValueSql "TBL_Reputacja" %A9 "FLD_POINT,FLD_CHARACTER" [@Point_DELL]
[@Point_DELL()]
#ACT
FormatStr "FLD_CHARACTER='%s'" %USERNAME
Mov A8 %A9
Dec D2 1 ; Inc D2 10;
Mov D4 %D2
FormatStr "FLD_Point='%s'" %D4
UPDATEVALUESQL "TBL_Reputacja" %A8 %A9

The script say:

DEC D2 * AND MOVE D2 TO D4 FOR SET D4 IN SQL.
 
Upvote 0

astral

Dedicated Member
Dedicated Member
Dec 14, 2012
109
3
45
Poland
Thank's!


Do I have another question?
!
And how to do #IF in sql?
When the account is 0 you can not act?

---------- Post Merged on 11-09-2018 at 07:26 PM ---------- Previous Post was on 09-09-2018 at 05:17 PM ----------

Any Help?
 
Upvote 0

DjDarkBoyZ

Dev
Golden Oldie
Aug 11, 2006
1,065
228
260
127.Ø.Ø.1
Thank's!


Do I have another question?
!
And how to do #IF in sql?
When the account is 0 you can not act?

---------- Post Merged on 11-09-2018 at 07:26 PM ---------- Previous Post was on 09-09-2018 at 05:17 PM ----------

Any Help?

there is no if for sql directly, u need to read the value u want to check and check using normal scripting.

after u do the sql read u can "check" the values using
#if
equal variable value
#act
.....

equal <- is for check equal values
elarge <- is for check equal and bigger values
esmall <- is for check equal or smaller values

good luck ;)
 
  • Like
Reactions: zedina
Upvote 0