Jump to content
MakeWebGames

Enable site wide double xp


Recommended Posts

Hi, I have just created a mod for my site where you can enable double exp gain for all players and have decided to release it for free to the community. any other game engines i.e Dayo want to use this with the game or add it to their engines feel free.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

here is the function that needs to be added to staff main. I have made it that you can either add a time duration or set it to perma double XP. it will also send out an announcement to all player everytime double XP is activated and deactivated.
Forgot to put in code block below you need to add case 'doublexp' doublexp(); break to the switch for action on main.php page

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

on either mainmenu where I have mine placed or you can place it on the header or whatever file you use for the template

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Add this code to the hour cron

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

as it is it couldn't but can edit the code so that it could do that. Easiest way would be to create a new table that has a timestamp of when it starts and end and change the code that within an if statement checks the date or current timestamp is greater than the start and less than end time.

Prob could do this for you tomorrow and add that code to this to

Link to comment
Share on other sites

There is a way that you can do this without altering any existing code.

You can add a new field into the user table that holds a copy of the users exp. On each page load you can compare the two. If the users exp is greater then copy you subtract the two to calculate how much exp they gained then you can add it again (if x2 exp is active) and update the copy to the new exp value too.

Link to comment
Share on other sites

On 7/2/2023 at 9:58 PM, corruptcity || skalman said:

as it is it couldn't but can edit the code so that it could do that. Easiest way would be to create a new table that has a timestamp of when it starts and end and change the code that within an if statement checks the date or current timestamp is greater than the start and less than end time.

Prob could do this for you tomorrow and add that code to this to

I mean it your Code you can add it if you want but I only asked the question now i have an answer I gonna try to implant it in my game

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.

×
×
  • Create New...