Check my sql

11/30/2014 12:45 supnasi#1
i've got an error in my sql.. the third item can't be bought.. here's the code
Code:
INSERT INTO `cq_action` VALUES ('10003000', '10003001', '0000', '0101', '0', 'Hey!~Wanna~buy~some~Donation Items?~I~Have~loads!');
INSERT INTO `cq_action` VALUES ('10003001', '10003013', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255Gear~for~50~ChlothariusPoints10003003');
INSERT INTO `cq_action` VALUES ('10003002', '4000026', '0000', '0102', '0', 'Nevermind 0');
INSERT INTO `cq_action` VALUES ('10003003', '10003005', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003004', '0000', '0000', '0126', '0', 'You~dont~have~enough~room~with~you!');
INSERT INTO `cq_action` VALUES ('10003005', '10003006', '10003008', '1001', '0', 'bonuspoint < 50');
INSERT INTO `cq_action` VALUES ('10003006', '10003007', '0000', '0101', '0', 'You~do~not~have~enough~CP!');
INSERT INTO `cq_action` VALUES ('10003007', '4000026', '0000', '0102', '0', 'I\'m~Sorry 0');
INSERT INTO `cq_action` VALUES ('10003008', '10003009', '0000', '0501', '1020016', '');
INSERT INTO `cq_action` VALUES ('10003009', '10003010', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,724041,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003010', '10003011', '0000', '1001', '0', 'bonuspoint += -50');
INSERT INTO `cq_action` VALUES ('10003011', '10003012', '0000', '0101', '0', 'Enjoy~your~+255Gears!');
INSERT INTO `cq_action` VALUES ('10003012', '4000026', '0000', '0102', '0', 'Thanks 0');
INSERT INTO `cq_action` VALUES ('10003013', '10003020', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255FullElement~for~100~ChlothariusPoints! 10003014');
INSERT INTO `cq_action` VALUES ('10003014', '10003016', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003015', '10003017', '0000', '0501', '1020017', '0');
INSERT INTO `cq_action` VALUES ('10003016', '10003006', '10003015', '1001', '0', 'bonuspoint < 100');
INSERT INTO `cq_action` VALUES ('10003017', '10003018', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,813002,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003018', '10003019', '0000', '1001', '0', 'bonuspoint += -100');
INSERT INTO `cq_action` VALUES ('10003019', '10003012', '0000', '0101', '0', 'Enjoy~your~+255FullElement!');
INSERT INTO `cq_action` VALUES ('10003020', '10003002', '0000', '0102', '0', 'I~would~like~to~upgrade~my~equipment~to~+255FullElement~for~75~ChlothariusPoints! 10003021');
INSERT INTO `cq_action` VALUES ('10003021', '10003023', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003022', '10003024', '0000', '0501', '1020018', '0');
INSERT INTO `cq_action` VALUES ('10003023', '10003006', '10003021', '1001', '0', 'bonuspoint < 75');
INSERT INTO `cq_action` VALUES ('10003024', '10003025', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,813002,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003025', '10003024', '0000', '1001', '0', 'bonuspoint += 75');
INSERT INTO `cq_action` VALUES ('10003026', '10003012', '0000', '0101', '0', 'Contact~PM~to~upgrade!');

INSERT INTO `cq_task` VALUES ('10003005', '10003005', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003000', '10003000', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003003', '10003003', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003014', '10003014', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003016', '10003016', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003021', '10003021', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003023', '10003023', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');

INSERT INTO `cq_npc` VALUES ('100001', '0', '0', 'DonationEq', '0002', '12106', '0', '0', '-1', '1000', '279', '536', '10003000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '?T', '0000', '00', '00', '0000', '01', '0000', '0000', '0000', '0000', '0000');
12/01/2014 09:26 magewarior2#2
Quote:
INSERT INTO `cq_action` VALUES ('10003001', '10003013', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255Gear~for~50~ChlothariusPoints10003003')
is has to be

Quote:
INSERT INTO `cq_action` VALUES ('10003001', '10003013', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255Gear~for~50~ChlothariusPoints 10003003')
good luck
12/01/2014 16:20 supnasi#3
didn't work man.. btw, thanks..
12/01/2014 23:10 magewarior2#4
oh, 3th item, i see a problem there...

Quote:
INSERT INTO `cq_action` VALUES ('10003020', '10003002', '0000', '0102', '0', 'I~would~like~to~upgrade~my~equipment~to~+255FullE lement~for~75~ChlothariusPoints! 10003021');
INSERT INTO `cq_action` VALUES ('10003021', '10003023', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003022', '10003024', '0000', '0501', '1020018', '0');
INSERT INTO `cq_action` VALUES ('10003023', '10003006', '10003021', '1001', '0', 'bonuspoint < 75');
it ahs to be 10003024??
12/03/2014 02:20 supnasi#5
Quote:
Originally Posted by magewarior2 View Post
oh, 3th item, i see a problem there...



it ahs to be 10003024??
didn't work too
12/03/2014 09:44 magewarior2#6
Quote:
Originally Posted by supnasi View Post
didn't work too
Run the action in game on a pm acc, and show a screenshot of all the executed code. This way i know where the error is arround.
12/15/2014 18:29 supnasi#7
sorry i'm late.. busy somewhere..
here's the ss
[Only registered and activated users can see links. Click Here To Register...]

also.. i've tested buying it with char with no bonuspoint on them.. unfortunately, the item is still given but not the 3rd one..
then.. if i used a char that have bonuspoint on them and buy the 3rd item, its bonus point is substracted by them sum up of the prices..

thx for helping
12/18/2014 03:15 idlemonkey#8
you made a loop in the last action
Code:
10003024  10003025
10003025  10003024
this will just replay the same two actions over and over again ...
which is why if you notice they are being highlighted with green and flashing repeatedly when you run this

it is because it cant stop till it gets to the max allowed action calls in ur gameserver

if the portion of this script is the same as the parts that came before it you should make ur idnext the one that requires the item to trade ....

however having said that


this action is flawed to begin with and written backwards .... you should run your checks and such and then require your items and then award points and then award item and create your log in this order .... that way if something does not pass you do not have to add a next fail to change whatever it is back to what it was before.

also this is extremely over complicated with more rows than you need .... this could be simplified a lot



dont waste brain power over thinking things
12/18/2014 06:04 supnasi#9
thanks man.. it works.. but the third item is still not given.. here's the edited sql
Code:
INSERT INTO `cq_action` VALUES ('10003000', '10003001', '0000', '0101', '0', 'Hey!~Wanna~buy~some~Donation Items?~I~Have~loads!');
INSERT INTO `cq_action` VALUES ('10003001', '10003013', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255Gear~for~50~CP~Tokens10003003');
INSERT INTO `cq_action` VALUES ('10003002', '4000026', '0000', '0102', '0', 'Nevermind 0');
INSERT INTO `cq_action` VALUES ('10003003', '10003005', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003004', '0000', '0000', '0126', '0', 'You~dont~have~enough~room~with~you!');
INSERT INTO `cq_action` VALUES ('10003005', '10003006', '10003008', '1001', '0', 'bonuspoint < 50');
INSERT INTO `cq_action` VALUES ('10003006', '10003007', '0000', '0101', '0', 'You~do~not~have~enough~CP!');
INSERT INTO `cq_action` VALUES ('10003007', '4000026', '0000', '0102', '0', 'I\'m~Sorry 0');
INSERT INTO `cq_action` VALUES ('10003008', '10003009', '0000', '0501', '1020016', '');
INSERT INTO `cq_action` VALUES ('10003009', '10003010', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,724041,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003010', '10003011', '0000', '1001', '0', 'bonuspoint += -50');
INSERT INTO `cq_action` VALUES ('10003011', '10003012', '0000', '0101', '0', 'Enjoy~your~+255Gears!');
INSERT INTO `cq_action` VALUES ('10003012', '4000026', '0000', '0102', '0', 'Thanks 0');
INSERT INTO `cq_action` VALUES ('10003013', '10003020', '0000', '0102', '0', 'I~would~like~to~Buy~a~+255FullElement~for~100~CP~Tokens! 10003014');
INSERT INTO `cq_action` VALUES ('10003014', '10003016', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003015', '10003017', '0000', '0501', '1020017', '0');
INSERT INTO `cq_action` VALUES ('10003016', '10003006', '10003015', '1001', '0', 'bonuspoint < 100');
INSERT INTO `cq_action` VALUES ('10003017', '10003018', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,813002,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003018', '10003019', '0000', '1001', '0', 'bonuspoint += -100');
INSERT INTO `cq_action` VALUES ('10003019', '10003012', '0000', '0101', '0', 'Enjoy~your~+255FullElement!');
INSERT INTO `cq_action` VALUES ('10003020', '10003002', '0000', '0102', '0', 'I~would~like~to~upgrade~an~equipment~for~10~CP~Tokens! 10003021');
INSERT INTO `cq_action` VALUES ('10003021', '10003023', '10003004', '0508', '0', '1 0 50');
INSERT INTO `cq_action` VALUES ('10003022', '10003024', '0000', '0501', '1020018', '0');
INSERT INTO `cq_action` VALUES ('10003023', '10003006', '10003021', '1001', '0', 'bonuspoint < 75');
INSERT INTO `cq_action` VALUES ('10003024', '10003025', '0000', '1085', '0', 'gmlog/action_log 330,%user_name[%user_id],0,1059,813002,0,0,0,10003000,0');
INSERT INTO `cq_action` VALUES ('10003025', '10003026', '0000', '1001', '0', 'bonuspoint += 75');
INSERT INTO `cq_action` VALUES ('10003026', '10003012', '0000', '0101', '0', 'Contact~PM~to~upgrade~your~weapon!');

INSERT INTO `cq_task` VALUES ('10003005', '10003005', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003000', '10003000', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003003', '10003003', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003014', '10003014', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003016', '10003016', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003021', '10003021', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');
INSERT INTO `cq_task` VALUES ('10003023', '10003023', '0000', '', '', '0', '0', '999', '-100000', '100000', '0999', '0000', '0', '-1', '0');

INSERT INTO `cq_npc` VALUES ('100001', '0', '0', 'DonationEq', '0002', '12106', '0', '0', '-1', '1000', '279', '536', '10003000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', '?T', '0000', '00', '00', '0000', '01', '0000', '0000', '0000', '0000', '0000');
12/18/2014 09:21 no_1#10
Quote:
Originally Posted by supnasi View Post
thanks man.. it works.. but the third item is still not given.. here's the edited sql
Code:
INSERT INTO `cq_action` VALUES ('10003023', '10003006', '10003021', '1001', '0', 'bonuspoint < 75');');
here is your error 10003021 need to be 10003022
12/23/2014 15:01 supnasi#11
worked! thanks bro