[REVCMS] Simple little addon, random prize award script for client

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Mr VPS - Cheap VPS Server NOC is offline
    MemberRank
    Sep 2011 Join Date
    Liverpool, UKLocation
    844Posts

    [REVCMS] Simple little addon, random prize award script for client

    Hey

    I see people wanting neat little addons for RevCMS
    Works with Standard PHX / GTE database

    I made a simple random little prize award script, great for using on your client to reward users, easy to expand on and edit

    Currently setup to award a random prize of either credits, pixels, shells (vip points) or a furni

    Hope its useful for some people




    Simply copy and paste the code below at the top of your client.php file and edit prizes for your own hotel


    Credits :

    Kryptos - Rev VMS
    Me - Coding this addon
    @Robot - Helping test script
    @Katrina2015 - Helping test the script

    <?php
    $random = rand(95,358); // Random number range, closer the min and max more chance of winning
    switch ($random){

    case 98: // Credits
    mysql_query("UPDATE users SET credits = credits+500 WHERE id = '".$_SESSION['user']['id']."'");
    echo "<script>alert('Congratulations!, {username} You have won 500 credits');</script>";
    break;

    case 186: // Pixels
    mysql_query("UPDATE users SET activity_points = activity_points+500 WHERE id = '".$_SESSION['user']['id']."'");
    echo "<script>alert('Congratulations!, {username} You have won 500 pixels');</script>";
    break;

    case 356: // Points
    mysql_query("UPDATE users SET vip_points = vip_points+50 WHERE id = '".$_SESSION['user']['id']."'");
    echo "<script>alert('Congratulations!, {username} You have won 50 points');</script>";
    break;

    case 239: // furni // Furni ID 202 is throne in basic phx catalogue
    mysql_query("INSERT INTO items (`user_id`, `base_item`) VALUES ('".$_SESSION['user']['id']."', 202);");
    echo "<script>alert('Congratulations!, {username} You have won a rare throne');</script>";
    break;
    }

    ?>
    Last edited by NOC; 21-09-15 at 10:44 PM.


  2. #2
    Retired Robot is offline
    MemberRank
    Apr 2015 Join Date
    EnglandLocation
    720Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Nice release Johno, keep up the good work!

  3. #3
    Valued Member ToxRetros is offline
    MemberRank
    Jul 2015 Join Date
    Habbo ReleasesLocation
    102Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Great release!

  4. #4
    Typescript XOXO LeChris is offline
    MemberRank
    Sep 2011 Join Date
    749Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Thanks for this mate! It's always nice seeing something original every now and then

  5. #5
    Not so spooky... MrSpooks is offline
    MemberRank
    May 2010 Join Date
    Under a rockLocation
    1,068Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Ahh cheers for this johno. Nice work :)

  6. #6
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    This can however be further developed , such as having the users to click on a button , lets say "Lucky draw of the day"

    Would make thing more fun yeah?


    However so , good release , this is something new. Good work

  7. #7
    Enthusiast Katrina2015 is offline
    MemberRank
    Jun 2015 Join Date
    34Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Great Release Johno thanks for this will deffo come to good use on Yablow

  8. #8
    iiiiiiiiiii Brought is offline
    MemberRank
    Aug 2013 Join Date
    469Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    This is awesome!

    Idea for anyone who would like to go about doing it - make the hotelview_promos have the option for a random vault crack and when you click the button (once every 24 hrs) it runs this script

  9. #9
    Member Lasers is offline
    MemberRank
    Aug 2009 Join Date
    76Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Great release! I will be adding this to my hotel for sure.

    Is there any way you could make it so that the person receives furni instead of just coins/pixels/points?

  10. #10
    Account Upgraded | Title Enabled! Vimsoration is offline
    MemberRank
    Apr 2015 Join Date
    USALocation
    238Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Thanks, this is really handy. One thing, now everyone is gonna refresh the whole time the client to get prizes.


    Quote Originally Posted by Lasers View Post
    Great release! I will be adding this to my hotel for sure.

    Is there any way you could make it so that the person receives furni instead of just coins/pixels/points?
    Look at case 239.

    case 239: // furni // Furni ID 202 is throne in basic phx catalogue

    mysql_query("INSERT INTO items (`user_id`, `base_item`) VALUES ('".$_SESSION['user']['id']."', 202);");
    echo "<script>alert('Congratulations!, {username} You have won a rare throne');</script>";
    break;
    }

    ?>

  11. #11
    Member Lasers is offline
    MemberRank
    Aug 2009 Join Date
    76Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Quote Originally Posted by Vimsoration View Post
    Thanks, this is really handy. One thing, now everyone is gonna refresh the whole time the client to get prizes.




    Look at case 239.

    case 239: // furni // Furni ID 202 is throne in basic phx catalogue

    mysql_query("INSERT INTO items (`user_id`, `base_item`) VALUES ('".$_SESSION['user']['id']."', 202);");
    echo "<script>alert('Congratulations!, {username} You have won a rare throne');</script>";
    break;
    }

    ?>
    I missed that.. Scrolled through a little too fast I guess. Now I like this even more! This is absolutely genius and a very fun thing to have on a retro. This way that one person that always wins events doesn't get everything that is released to the users. Thank you very much for this! Can't wait to see your future releases, if there will be any of course. Good luck!

    Is there any way of making the users win these less or more frequently?

    Oh and do you know if this will work for AzureEMU?

    Sorry about all the questions, but could you make it so that there is only 1 prize every 24 hours? That would reduce refresh spam and wouldn't hurt the ECO that much.
    Last edited by Lasers; 23-09-15 at 10:06 AM.

  12. #12
    Mr VPS - Cheap VPS Server NOC is offline
    MemberRank
    Sep 2011 Join Date
    Liverpool, UKLocation
    844Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Quote Originally Posted by Vimsoration View Post
    Thanks, this is really handy. One thing, now everyone is gonna refresh the whole time the client to get prizes.




    Look at case 239.

    case 239: // furni // Furni ID 202 is throne in basic phx catalogue

    mysql_query("INSERT INTO items (`user_id`, `base_item`) VALUES ('".$_SESSION['user']['id']."', 202);");
    echo "<script>alert('Congratulations!, {username} You have won a rare throne');</script>";
    break;
    }

    ?>
    I highly doubt people are actually that sad to sit refreshing the client just to win a prize.

    Quote Originally Posted by Lasers View Post
    I missed that.. Scrolled through a little too fast I guess. Now I like this even more! This is absolutely genius and a very fun thing to have on a retro. This way that one person that always wins events doesn't get everything that is released to the users. Thank you very much for this! Can't wait to see your future releases, if there will be any of course. Good luck!

    Is there any way of making the users win these less or more frequently?

    Oh and do you know if this will work for AzureEMU?

    Sorry about all the questions, but could you make it so that there is only 1 prize every 24 hours? That would reduce refresh spam and wouldn't hurt the ECO that much.
    If you change the range of the random, the smaller the range the higher chance of winning, the bigger the range the less chance of winning, I am nearly done coding a page with a button that allows 1 try per account per day.

  13. #13
    Member Lasers is offline
    MemberRank
    Aug 2009 Join Date
    76Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Quote Originally Posted by Johno View Post
    I highly doubt people are actually that sad to sit refreshing the client just to win a prize.



    If you change the range of the random, the smaller the range the higher chance of winning, the bigger the range the less chance of winning, I am nearly done coding a page with a button that allows 1 try per account per day.
    Alright thanks, will you be releasing the code for that button? If you are, please tag me on the thread. :D I'm glad to see that someone on here is still trying to keep this part of the forum alive.

  14. #14
    iiiiiiiiiii Brought is offline
    MemberRank
    Aug 2013 Join Date
    469Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    Quote Originally Posted by Vimsoration View Post
    Thanks, this is really handy. One thing, now everyone is gonna refresh the whole time the client to get prizes.
    Could you not make it check for your IP and only be able to send x to each IP in the users table as current one time?

  15. #15
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,479Posts

    Re: [REVCMS] Simple little addon, random prize award script for client

    It's 2015 and people are still using deprecated MySQL functions in PHP.

    It's been 3 fucking years since it the deprecation was announced.



Page 1 of 2 12 LastLast

Advertisement