athena26 Posted April 4, 2021 Share Posted April 4, 2021 Could anyone tell me how I could add 4 NPC 'bots' to be constantly in jail to be jail broken.... Every time they get jail bust 5 seconds after they return back into jail ... Quote Link to comment Share on other sites More sharing options...
SRB Posted April 4, 2021 Share Posted April 4, 2021 (edited) In your minute cron, add something like ... $db->query("UPDATE users SET jail = 15 WHERE userid IN (1, 2, 3, 4) AND jail = 0"); Replacing 1, 2, 3 and 4 with the account IDs of the NPC's. Note: I'm not 100% certain the method for query execution is query() - but you should be able to see if it's not from the other queries in the cron file. Edited April 5, 2021 by SRB Fixed query 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted April 4, 2021 Share Posted April 4, 2021 1 hour ago, athena26 said: Could anyone tell me how I could add 4 NPC 'bots' to be constantly in jail to be jail broken.... Every time they get jail bust 5 seconds after they return back into jail ... Wonderful idea!! Quote Link to comment Share on other sites More sharing options...
twison Posted April 4, 2021 Share Posted April 4, 2021 (edited) You could simply create 4 fake users (bots) and then give them each 1 day in jail. Then you could add a Update query in a global file to put them back in jail if they are no longer in jail. With it being in a global file like a header file every time a page is loaded by a user the query is used so as long as a user is online doing stuff the bot will always be in jail for 1 day. The is just a basic idea of how you could do it with the littlest changes to the coding as possible without having to alter or create a new section of the DB. That's a pretty good idea btw! Oh and something I usually like adding in is the option to throw rotten tomatoes at the people in jail, it's all in good fun. 😛 Edited April 4, 2021 by twison 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted April 4, 2021 Share Posted April 4, 2021 Instead of 5 secs. Just never remove them from jail? 5 secs is not much time anyway? 1 Quote Link to comment Share on other sites More sharing options...
Dayo Posted April 4, 2021 Share Posted April 4, 2021 I've made this mod for a few people, it will make several bots and add them in jail in different locations 1 Quote Link to comment Share on other sites More sharing options...
athena26 Posted April 4, 2021 Author Share Posted April 4, 2021 (edited) Basically keep them in jail every 24 hours every time they get busted out they automatically return it's only because my jail bust gains 1000 labour per bust, labour only earned by jail bust I removed the gym function of labour . 3 hours ago, SRB said: In your minute cron, add something like ... $db->query("UPDATE users SET jail = 15 WHERE userid IN (1, 2, 3, 4") AND jail = 0; $db->query("UPDATE users SET jail = 15 WHERE userid IN (1, 2, 3, 4") AND jail = 0; Replacing 1, 2, 3 and 4 with the account IDs of the NPC's. Note: I'm not 100% certain the method for query execution is query() - but you should be able to see if it's not from the other queries in the cron file. This didn't work but thanks. 1 hour ago, Sim said: Instead of 5 secs. Just never remove them from jail? 5 secs is not much time anyway? 3 seconds would be good just because of people having timers . Another great idea that I'm thinking to do , as a gang mod.... When a gang member breaks another gang member from jail they gain double labour experience ... Edited April 4, 2021 by athena26 Quote Link to comment Share on other sites More sharing options...
twison Posted April 4, 2021 Share Posted April 4, 2021 $db->query("UPDATE users SET jail = 15 WHERE user_level = 0 AND jail = 0"); Adding something like this to your header.php should work just fine if the userlevel of the npc accounts is set to 0. This will put the npc in jail for 15 minutes every time a page is loaded by a user as long as the npc is not in jail. You can tweak it however fits your needs but should work just fine for what you're wanting to do. Quote Link to comment Share on other sites More sharing options...
MNG Posted April 4, 2021 Share Posted April 4, 2021 (edited) 59 minutes ago, athena26 said: Basically keep them in jail every 24 hours every time they get busted out they automatically return it's only because my jail bust gains 1000 labour per bust, labour only earned by jail bust I removed the gym function of labour . This didn't work but thanks. 3 seconds would be good just because of people having timers . Another great idea that I'm thinking to do , as a gang mod.... When a gang member breaks another gang member from jail they gain double labour experience ... It should of, I just tested this on my game. Try this, if your running the outdated version. Open up ya cron five file and follow these instructions Under $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; Add this $query182="UPDATE users SET jail = 15 WHERE userid IN (6) AND jail = 0"; Then find this $db->query($query4); and add this under it $db->query($query182); Edited April 4, 2021 by MNG 1 Quote Link to comment Share on other sites More sharing options...
SRB Posted April 5, 2021 Share Posted April 5, 2021 7 hours ago, SRB said: In your minute cron, add something like ... $db->query("UPDATE users SET jail = 15 WHERE userid IN (1, 2, 3, 4) AND jail = 0"); $db->query("UPDATE users SET jail = 15 WHERE userid IN (1, 2, 3, 4) AND jail = 0"); Replacing 1, 2, 3 and 4 with the account IDs of the NPC's. Note: I'm not 100% certain the method for query execution is query() - but you should be able to see if it's not from the other queries in the cron file. The query was broken - that should work now, as is. 1 Quote Link to comment Share on other sites More sharing options...
Veramys Posted April 5, 2021 Share Posted April 5, 2021 You need to create the NPC accounts for them to be added to the jail with that query. 1 Quote Link to comment Share on other sites More sharing options...
athena26 Posted April 5, 2021 Author Share Posted April 5, 2021 8 hours ago, MNG said: It should of, I just tested this on my game. Try this, if your running the outdated version. Open up ya cron five file and follow these instructions Under $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; Add this $query182="UPDATE users SET jail = 15 WHERE userid IN (6) AND jail = 0"; $query182="UPDATE users SET jail = 15 WHERE userid IN (6) AND jail = 0"; Then find this $db->query($query4); $db->query($query4); and add this under it $db->query($query182); $db->query($query182); 10 hours ago, Sim said: This works but it takes a minute for the dealer to go back into jail It works perfectly tha m you guys now all I need is to add the users image in jail, I know my jail file is to basic 😂 13 hours ago, twison said: $db->query("UPDATE users SET jail = 15 WHERE user_level = 0 AND jail = 0"); $db->query("UPDATE users SET jail = 15 WHERE user_level = 0 AND jail = 0"); Adding something like this to your header.php should work just fine if the userlevel of the npc accounts is set to 0. This will put the npc in jail for 15 minutes every time a page is loaded by a user as long as the npc is not in jail. You can tweak it however fits your needs but should work just fine for what you're wanting to do. Only issue with this all bots from battle tent go to jail and they can't be attacked whilst in jail 1 Quote Link to comment Share on other sites More sharing options...
MNG Posted April 5, 2021 Share Posted April 5, 2021 9 hours ago, athena26 said: It works perfectly tha m you guys now all I need is to add the users image in jail, I know my jail file is to basic 😂 Only issue with this all bots from battle tent go to jail and they can't be attacked whilst in jail Your best bet is to make jail bots and attack bots separate Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.