Jump to content
MakeWebGames

Modification Help


CHAMAVELI
 Share

Recommended Posts

Hey guys im making my own mod (not from scratch) by modifying the Mccodes V2 attack system and make it available in jail. I needed help with two things, the user will have to have a certain item to attack in jail, and I need to know the code to check if the user has the item. The second thing I need help with is that the user will need to make this item in jail, it takes 100 energy and will take 10 minutes. Should I make this file to make the item set something in the database to 10 and every minute the cron will remove one? If it works like this how would i make the cron credit the user with the item after the 10 minutes is over, something like if the make-item-time coloumn = 1 then it would set 1 to 0 and credit the user with the item?

I'm not sure if it makes sence but I need someone to help me because im new to PHP but this sounds like an easy mod. Thanks.

Link to comment
Share on other sites

Re: Modification Help

Why would you use a cron to do this?

Should I make this file to make the item set something in the database to 10 and every minute the cron will remove one? If it works like this how would i make the cron credit the user with the item after the 10 minutes is over, something like if the make-item-time coloumn = 1 then it would set 1 to 0 and credit the user with the item?

Would be much better to use a unix*timestamp so when they start making it counts down and just a $db->query to remove the energy!

If your wanting to do this yourself, you might want to start off with making those pathetic *Slap* or *Poke* mods and then slowly improve. The query needed to select an item from inventory is a horrible but of code! I suggest instead of using that query, adding the code to make the item taking the energy and time to make, then when its completed, just have a little event that will then allow attacking whilst they are in Jail and when they go out of jail, the item isnt their anymore, hard to explain!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...