Page 1 of 1

Jail time

Posted: Thu Jan 25, 2018 8:21 am
by Rodeobull
hi

i use the jailbust module for my game and found a bug

in the admin panel you can set the max time that you can be in jail
but when i do a crime or steal anything from shops i always end up in jail with that max time there is set in the admin panel
even when i put myself in jail for any time it will always be that max jail time

i found this part in jailbust and maybe the problem is there

Code: Select all

$result =
        $db->Execute("select reason.value as reason, h1.value as level, u.username, u.id,
                      (jail.value + (length.value*60) - ?) / 60 as endtime 
        	      from users u
        	      left join (select * from user_stats where stat_type = 7) h1 on u.id = h1.user_id
	              inner join user_variables jail on u.id = jail.user_id
	                  and jail.variable_id = ?
	              inner join user_variables length on u.id = length.user_id
	                  and length.variable_id = ?
	              inner join user_variables reason on u.id = reason.user_id
	                  and reason.variable_id = ?
	              where (jail.value + (length.value*60) - ?)/ 60 between 0 and ?
	              order by jail.value + (length.value*60) - time_to_sec(now()), u.id", 
	                 time(), $jailId, $jailLengthId, $jailReasonId, time(), $param1);

Re: Jail time

Posted: Thu Jan 25, 2018 4:36 pm
by hallsofvallhalla
Thanks for sharing!

Re: Jail time

Posted: Thu Jan 25, 2018 5:03 pm
by Rodeobull
not sharing anything its a question to help me :p

Re: Jail time

Posted: Thu Jan 25, 2018 6:56 pm
by hallsofvallhalla
Hmm i may have not seen all teh message as it looked like you found a bug and was showing the fix to us, haha sorry.