"Limit of coins" [PHPRetro/HoloCMS Addon]

Page 1 of 2 12 LastLast
Results 1 to 25 of 31
  1. #1
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    "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']; ?> &raquo;</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.
    Last edited by Obvilion; 06-03-10 at 01:36 AM.


  2. #2
    yerro Adde is offline
    MemberRank
    Feb 2010 Join Date
    none ur bizzLocation
    2,731Posts

    Re: [REL] HoloCMS Add-On "Limit of coins"

    It looks really good.

    Ima try this!

  3. #3
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    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.

  4. #4
    Account Upgraded | Title Enabled! Darknesshotel is offline
    MemberRank
    Apr 2009 Join Date
    At Home!Location
    278Posts

    Re: [REL] HoloCMS Add-On "Limit of coins"

    If you can code it for PHPRetro itll be GREAT

  5. #5
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    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>"
    ;
        }
    }
    ?>

  6. #6
    Member JosNL is offline
    MemberRank
    May 2007 Join Date
    The NetherlandsLocation
    67Posts

    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

  7. #7
    Account Upgraded | Title Enabled! Pure is offline
    MemberRank
    May 2008 Join Date
    809Posts

    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 limitso 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 limitso 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.

  8. #8
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    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']; ?> &raquo;</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)
    Last edited by Obvilion; 06-03-10 at 01:37 AM.

  9. #9
    Account Upgraded | Title Enabled! Pure is offline
    MemberRank
    May 2008 Join Date
    809Posts

    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.

  10. #10
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    Re: [REL] HoloCMS Add-On "Limit of coins"

    Quote Originally Posted by iJames View Post
    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.

  11. #11
    Account Upgraded | Title Enabled! Pure is offline
    MemberRank
    May 2008 Join Date
    809Posts

    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 ^_^.

  12. #12
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"

    Really creative, James.

  13. #13
    Apprentice TheNixxez is offline
    MemberRank
    Mar 2010 Join Date
    5Posts

    Re: [REL] HoloCMS/PHPRetro Add-On "Limit of coins"

    can you adit a screenshot `?

  14. #14

    me ridez bykes

    Sean is offline

    LegendRank
    Jun 2007 Join Date
    JerseyLocation
    4,098Posts

    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

  15. #15
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    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 
    Last edited by Obvilion; 08-03-10 at 11:21 AM.

  16. #16
    Account Upgraded | Title Enabled! Pure is offline
    MemberRank
    May 2008 Join Date
    809Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    That's better, this type of code belongs in the emulator.

  17. #17
    Demi-God tweeney is offline
    MemberRank
    Aug 2008 Join Date
    888Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    Quote Originally Posted by Obvilion View Post
    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?

  18. #18
    Developer Eronisch is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    1,328Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    The php code is from AresCJ, he released this on ótaku studios.

  19. #19
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    Quote Originally Posted by Eronisch View Post
    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.
    Last edited by Obvilion; 08-03-10 at 06:55 PM.

  20. #20
    Demi-God tweeney is offline
    MemberRank
    Aug 2008 Join Date
    888Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    Where would the server code go and would it work in holopooling?

  21. #21
    Enthusiast functi0n is offline
    MemberRank
    Mar 2010 Join Date
    At home?Location
    40Posts

    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.

  22. #22
    Member Obvilion is offline
    MemberRank
    Feb 2010 Join Date
    95Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    Quote Originally Posted by tweeney View Post
    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.

  23. #23
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    DeveloperRank
    May 2007 Join Date
    InternetLocation
    2,464Posts

    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

  24. #24
    Crawl Me Maybe Crawl is offline
    MemberRank
    Aug 2009 Join Date
    Behind YouLocation
    2,142Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    This was released by aresCJ on otaku.. i see no credits.

  25. #25

    me ridez bykes

    Sean is offline

    LegendRank
    Jun 2007 Join Date
    JerseyLocation
    4,098Posts

    Re: HoloCMS/PHPRetro Add-On "Limit of coins"

    Quote Originally Posted by Solos View Post
    This was released by aresCJ on otaku.. i see no credits.
    he said he told him to release noob!!!



    there you go Solos thats for you ^^

    cya

    Peace,
    sean111



Page 1 of 2 12 LastLast

Advertisement