[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
http://i.imgur.com/ngqMinN.jpg
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
Quote:
<?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;
}
?>
Re: [REVCMS] Simple little addon, random prize award script for client
Nice release Johno, keep up the good work!
Re: [REVCMS] Simple little addon, random prize award script for client
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
Re: [REVCMS] Simple little addon, random prize award script for client
Ahh cheers for this johno. Nice work :)
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
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
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
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?
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
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;
}
?>
Re: [REVCMS] Simple little addon, random prize award script for client
Quote:
Originally Posted by
Vimsoration
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.
Re: [REVCMS] Simple little addon, random prize award script for client
Quote:
Originally Posted by
Vimsoration
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
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.
Re: [REVCMS] Simple little addon, random prize award script for client
Quote:
Originally Posted by
Johno
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.
Re: [REVCMS] Simple little addon, random prize award script for client
Quote:
Originally Posted by
Vimsoration
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?
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.