-
"Limit of coins" [PHPRetro/HoloCMS Addon]
I thought about something, I was like I get on these hotels and you realize these users go away with coins, getting millions and millions of coins, and you know... that slows the server down with a quickness, because coins are what's mostly bought in the hotels anyway, besides furniture. So I've coded a script, where if a user has exceeded the limit, then they will reduce back to whatever your limit is.
The code:
It's been revised and works.
PHP Code:
<?php
include('core.php');
$limit = 100000000;
if($myrow['credits'] > $limit)
{
echo "<script language=\"JavaScript\">\n;
alert('Your coins have exceeded the hotels limit, so you are being reduced to the limit.');\n;
</script>";
mysql_query("UPDATE users SET credits = ".$limit." WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
} else {
echo "<script language=\"JavaScript\">\n;
alert('You are under the limit, so your coins will stay safe!');
</script>";
}
?>
Coded it for PHPRetro as well:
Since the stuff is different, it took a while.
Place it in me.php under this code:
Code:
<ul id="link-bar" class="clearfix">
<li class="change-looks"><a href="<?php echo PATH; ?>/profile"><?php echo $lang->loc['change.looks']; ?> »</a></li>
<li class="credits">
<a href="<?php echo PATH; ?>/credits"><?php echo $user->user("credits"); ?></a> <?php echo $lang->loc['credits']; ?><br>
PHP Code:
<?php
$limit = 20000;
if($user->user("credits") > $limit)
{
echo 'Your coins have exceeded the hotels limit, so you are being reduced to the limit, the limit is: ';
echo $limit;
mysql_query("UPDATE users SET credits = ".$limit." WHERE id = ".$user->id."");
} else {
echo 'You are under the limit, so your coins will stay safe!';
}
?>
For HoloCMS place under the same code in me.php as well.
Do NOT make another php file for it. It's much easier.
-
Re: [REL] HoloCMS Add-On "Limit of coins"
It looks really good.
Ima try this!
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Thanks mate, you'll enjoy it, I'll think of some more ideas of add-ons and I'll make them.
-
Re: [REL] HoloCMS Add-On "Limit of coins"
If you can code it for PHPRetro itll be GREAT
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Revised the code, it was some errors in it:
PHP Code:
<?php
include('core.php');
function limitingCoins()
{
$limit = 100000000;
if($myrow['credits'] > $limit)
{
echo "<script language=\"JavaScript\">\n;
alert('Your coins have exceeded the hotels limit, so you are being reduced to the limit.');\n;
</script>";
mysql_query("UPDATE users SET credits = ".$limit." WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
} else {
echo "<script language=\"JavaScript\">\n;
alert('You are under the limit, so your coins will stay safe!');
</script>";
}
}
?>
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Very Nice man, i think i would use it if i had a retro!
Posted via Mobile Device
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Okay a couple of things.
Why don't you just code this into the core.php, instead of having an include - meh maybe thats just personal prefence.
PHP Code:
<?php
include('core.php');
function limitingCoins()
{
$limit = 100000000;
if($myrow['credits'] > $limit)
{
echo "<script language=\"JavaScript\">\n";
echo "alert("Your coins have exceeded the hotels limit, so you are being reduced to the limit.");\n";
echo "</script>";
mysql_query("UPDATE users SET credits = ".$limit." WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
} else {
echo "<script language=\"JavaScript\">\n";
echo "alert("You are under the limit, so your coins will stay safe!");\n";
echo "</script>";
}
}
?>
Firstly the code wouldn't even run, becasue your not excatuing the function limitingCoins();
Secondly, you should remove the else statement becasue you imagine on EVERY single page you load your going to get some shitty alert saying that you have the right amount of credits. How gay eh?
I think you should make some amendments to you code.
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Coded it for PHPRetro as well:
Since the stuff is different, it took a while.
Place it in me.php under this code:
Code:
<ul id="link-bar" class="clearfix">
<li class="change-looks"><a href="<?php echo PATH; ?>/profile"><?php echo $lang->loc['change.looks']; ?> »</a></li>
<li class="credits">
<a href="<?php echo PATH; ?>/credits"><?php echo $user->user("credits"); ?></a> <?php echo $lang->loc['credits']; ?><br>
PHP Code:
<?php
$limit = 20000;
if($user->user("credits") > $limit)
{
echo 'Your coins have exceeded the hotels limit, so you are being reduced to the limit, the limit is: ';
echo $limit;
mysql_query("UPDATE users SET credits = ".$limit." WHERE id = ".$user->id."");
} else {
echo 'You are under the limit, so your coins will stay safe!';
}
?>
P.S: I was already a step ahead of you, bro (iJames)
-
Re: [REL] HoloCMS Add-On "Limit of coins"
I think you should intergreate it better maybe in the 'nofication box.' Also, PhpRetro uses OOP for querys replace the mysql_query with $db->query();
I still think you should have the else statment. But hay you cant win them all.
-
Re: [REL] HoloCMS Add-On "Limit of coins"
Quote:
Originally Posted by
iJames
I think you should intergreate it better maybe in the 'nofication box.' Also, PhpRetro uses OOP for querys replace the mysql_query with $db->query();
I still think you should have the else statment. But hay you cant win them all.
You're right, but after all I coded this while I'm at work lol so I really didn't have time to just....... get on it and read every little detail.
-
Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"
Tbh, it's a very simple if statement tbh. It's not much of a release.
See my Epic Shop would be what you call a release.
http://www.epichotel.co.uk/shop
HoloShop for a v39 retro & phpretro ^_^.
-
Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"
-
Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"
can you adit a screenshot `?
-
Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"
Nice release Obvilion, ^^ put on your holocms/phpretro and you'll find out what it looks like (: cya
Peace,
sean111
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Thanks I've also coded it in C# and VB.NET
C#:
PHP Code:
#region coinlimit
int limit = 20000;
if (_Credits < limit)
{
sendData("BKYou now have " + _Credits + ", the limit is: " + limit + ", you are safe for now.");
}
else
{
if (_Credits > limit)
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET credits = " + limit + " WHERE id = " + userID + "");
sendData("You now have " + _Credits + ", your coins are now being reduced below the limit.");
}
}
#endregion
VB.NET:
PHP Code:
#Region "coinlimit"
Dim limit As Integer = 20000
If _Credits < limit Then
sendData("BKYou now have " & _Credits & ", the limit is: " & limit & ", you are safe for now.")
Else
If _Credits > limit Then
Using dbClient As DatabaseClient = Eucalypt.dbManager.GetClient()
dbClient.runQuery("UPDATE users SET credits = " & limit & " WHERE id = " & userID & "")
sendData("You now have " & _Credits & ", your coins are now being reduced below the limit.")
End Using
End If
End If
#End Region
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
That's better, this type of code belongs in the emulator.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Quote:
Originally Posted by
Obvilion
Thanks I've also coded it in C# and VB.NET
C#:
PHP Code:
#region coinlimit
int limit = 20000;
if (_Credits < limit)
{
sendData("BKYou now have " + _Credits + ", the limit is: " + limit + ", you are safe for now.");
}
else
{
if (_Credits > limit)
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET credits = " + limit + " WHERE id = " + userID + "");
sendData("You now have " + _Credits + ", your coins are now being reduced below the limit.");
}
}
#endregion
VB.NET:
PHP Code:
#Region "coinlimit"
Dim limit As Integer = 20000
If _Credits < limit Then
sendData("BKYou now have " & _Credits & ", the limit is: " & limit & ", you are safe for now.")
Else
If _Credits > limit Then
Using dbClient As DatabaseClient = Eucalypt.dbManager.GetClient()
dbClient.runQuery("UPDATE users SET credits = " & limit & " WHERE id = " & userID & "")
sendData("You now have " & _Credits & ", your coins are now being reduced below the limit.")
End Using
End If
End If
#End Region
Where would the code go and would it work in holopooling?
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
The php code is from AresCJ, he released this on ótaku studios.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Quote:
Originally Posted by
Eronisch
The php code is from AresCJ, he released this on ótaku studios.
No, it's not... I coded this and I told him to put on Otaku Studios, lmao.. What a noob of you, trying to once again make a fool out of me, because you can't code.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Where would the server code go and would it work in holopooling?
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Looks good, Im not to sure if its something i can use but this would be good on a request form for credits. Just say you can topup credits if your under 1000 the the most of 1000. There an idea :)
Will you allow me to use the source to speed my new project up, your get full rights to your side of cource.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Quote:
Originally Posted by
tweeney
Where would the server code go and would it work in holopooling?
The C# code works for holopooling and it'll got in the logging section. Where you login and you get the
PHP Code:
refreshCredits()
or something of the sort, not sure off the brain.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
You can use both scripts for Emu & Site, But if i was you remove the you are under the limit or you have X credits..
it only warns if you are over the limit and put it back to the limit
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
This was released by aresCJ on otaku.. i see no credits.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Quote:
Originally Posted by
Solos
This was released by aresCJ on otaku.. i see no credits.
he said he told him to release noob!!!
http://i228.photobucket.com/albums/e...f?t=1268163353
there you go Solos thats for you ^^
cya
Peace,
sean111
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Your post is very good, but members can purchase credits for them were coming in hand and not in the catalog ¬ ¬ apologize. im sorry
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
No, he doesnt. he says "So I've coded a script," I... I
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
Quote:
Originally Posted by
Solos
No, he doesnt. he says "So I've coded a script," I... I
To make you shutup, I'll tell AresCJ to post on here saying "Obvilion coded it, and he allowed me to release it on Otaku"
damn, you immigrants.
I'm working on the catalog portion as well, it'll be on the first post when I'm done
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
I didn't code none of this, so stop confronting him about this, when you know nothing. He told me I could release on Otaku, since he don't have a Otaku acc. So... I did. Besides, we work together all the time, we don't gotta put credits for each other because if he wanna release my work, he can just ask, and he'll get an answer and vice versa. Anyways, good job mate.
-
Re: HoloCMS/PHPRetro Add-On "Limit of coins"
o.O Cj Told Yous, Haha. Nice Work, Now My Credits Can't Go Through The Roof!:P:P:P
-
Re: "Limit of coins" [PHPRetro/HoloCMS Addon]