@niniyoh143
don't triple post
@quesoph
Backseat moderating is discouraged. Please use the Report button (available at the bottom right of each post).
just click the report button.
.
.
Code:
// check completed how many times.if( .@repeatable[.@i] ){query_sql( "SELECT COUNT(`id`),TIMESTAMPDIFF( HOUR,`completion`,NOW() ),DATE_ADD( `completion`, INTERVAL "+.@redo_delay+" HOUR) FROM `player_mission` WHERE `mission_id` = "+.@id[.@i]+" AND `completion` <> '0000-00-00 00:00:00'",.@mission_completed,.@diff_delay,.@day$ );if( .@repeatable[.@i] && ( ( .@mission_completed >= .@repeatable[.@i] ) || ( .@diff_delay && .@diff_delay <= .@redo_delay ) ) ){next;mes "^0055FF[ "+.@npc_name$+" ]^000000";mes " ";if( .@mission_completed >= .@repeatable[.@i] ){mes "You cant pick this mission, you have mission completion reach the max repeatable attempt of "+.@mission_completed+" times.";close;}if( .@diff_delay && .@diff_delay <= .@redo_delay ){mes "You cant pick this mission, you have mission redo delay isnt finish yet.";mes "Approximate : ^FF0000"+.@day$+"^000000";close;}}}
when I read this chunk of code, I immediately spotted 3 errors
1.
Code:
query_sql( "UPDATE `player_mission` SET `completion` = NOW() WHERE `cid` = "+getcharid(0)+" AND `mission_id` = "+.@mission_id );
as I thought
the correct way to update the missions should only update the mission that are not yet completion
but he update every rows included those has already completed
it should be update ... and completion = '000...'
2.
.@repeatable[.@i] ... that .@i isn't needed because the query_sql already did a limit 1 previously ...
and the .@i was conditioned before when listing all the quest list
so if there is more than 1 mission in the npc, this will always return 0
emistry probably test this part when he only has 1 mission in the npc .. he needs to setup more
3.
I wonder why he put both redo-delay and repeatable only with the repeatable condition ..
if admin setup the mission with only redo-delay but not repeatable, the redo-delay condition will not be read
they need to be split out in 2 different conditions ...
....
means you see it as 1 single bug
but there is actually 3 ...
this is not a simple script, I can't fix this immediately
will do this after dinner ... now I have to go out and eat