How to use Mus commands in revcms?

Results 1 to 1 of 1
  1. #1
    Account Upgraded | Title Enabled! UartigZone is offline
    MemberRank
    Dec 2013 Join Date
    LoserlandLocation
    441Posts

    ! How to use Mus commands in revcms?

    Hello,

    I got a 'rooms' page, when you can buy a custom room it set it in the database and work perfect and send a update_navigator mus command but when i try to get it working on another page ( when you can buy LTD ) its not working....

    When i buy the LTD and someone buy something in the catalogue they disconnect but if i use the :update_items command in the hotel BEFORE someone buy something in the catalogue they will NOT disconnect so how can i get the mus command to working in the page like the room models?

    Here is the room's models i'm talking about
    PHP Code:
    <?php    function sendMUS($header$data){        $ip "127.0.0.1";        $port 30001;        $musData $header chr(1) . $data;        $sock =  [MENTION=1333431411]Socket[/MENTION]_create(AF_INETSOCK_STREAMgetprotobyname('tcp'));      [MENTION=1333431411]Socket[/MENTION]_connect($sock$ip$port);      [MENTION=1333431411]Socket[/MENTION]_send($sock$musDatastrlen($musData), MSG_DONTROUTE);      [MENTION=1333431411]Socket[/MENTION]_close($sock);    }?><!DOCTYPE html><html lang="en">    <head>        <meta http-equiv="content-type" content="text/html; charset=utf-8">        <title>{hotelName} - Rum Models</title>        <link rel="shortcut icon" href="{url}/favicon.ico?<?php echo time() ?>" type="image/x-icon"/>        <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css?<?php echo time() ?>" type="text/css">        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js?<?php echo time() ?>"></script>        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js?<?php echo time() ?>"></script>        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js?<?php echo time() ?>"></script>        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js?<?php echo time() ?>"></script>        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js?<?php echo time() ?>"></script><style type="text/css">            .alert{                height:25px;                width:96%;                background-color:#c73c3c;                text-align:center;                border-radius:2px;                line-height:25px;                color:#fff;                font-weight:700;            }                        .alert a{                color:#fff;            }                        .alert-g{                height:25px;                width:100%;                background-color:#36AB3A;                text-align:center;                border-radius:2px;                line-height:25px;                color:#fff;                font-weight:700;                font-size:10px;            }                        .alert-box{                height:40px;                width:301px;                background-color:lightgreen;                margin-bottom:5px;                border-radius:3px;                text-align:center;                font-size:10px;                color:#fff;                font-weight:700;                line-height:38px;}                                            input{                height:25px;                border:1px solid lightgray;                border-radius:2px;                text-align:center;}                                    input[type='submit']{                background-image:none;                border:1px solid lightgray;                line-height:20px;}        </style>        <!--[if IE 8]>            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">        <![endif]-->        <!--[if lt IE 8]>            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />        <![endif]-->        <!--[if lt IE 7]>            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />            <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>            <script type="text/javascript">                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}            </script>            <style type="text/css">                body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }            </style>        <![endif]-->    </head>        <body id="home">            <div id="overlay"></div>        <div id="header-container">            <div id="header" class="clearfix">                <h1><a href="{url}/"></a></h1>                <div id="subnavi">                    <div id="subnavi-user">                       <div style="margin-top:7px;font-size:10px">
                         </div>                    </div>                    <div id="subnavi-search">                        <div id="subnavi-search-upper">                            <ul id="subnavi-search-links">                              <li><a href="{url}/logout" style="color:#000;font-size:10px;">Sign Out</a>                            </ul>                        </div>                    </div>                    <div id="to-hotel">                                     <a href="{url}/client" class="new-button green-button" target="05efbade773135677a28f2b338c5bdf93774237c" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter Rehab</b><i></i></a>                 </div>                </div>                <ul id="navi">                    <li><a href="{url}/me">{username}</a><span></span></li>                    <li><a href="{url}/community">Community</a><span></span></li>                    <li><a href="{url}/sikkerhed">Sikkerhed</a><span></span></li>                            <li class="selected"><strong>Shop</strong><span></span></li>                        </ul>                <div id="habbos-online" style="background-color:#FFF;border-radius:6px;"><div class="rounded"><span><b>{online}</b><br> Members Online!</span></div></div>            </div>        </div>        <div id="content-container">            <div id="navi2-container" class="pngbg">                <div id="navi2" class="pngbg clearfix">                    <ul>                       <li class=" last"><a href="{url}/shop" style="color:black">Shop</a></li>                       <li class=" last"><a href="{url}/vip" style="color:black">VIP</a></li>                               <li class=" last"><a href="{url}/diamanter" style="color:black">Diamant Shop</a></li>                                                   <li class=" last"><a href="{url}/badge" style="color:black">Skilt Shop</a></li>                        <li class=" last"><a href="{url}/bots" style="color:black">Bot Shop</a></li>                                <li class=" last"><a href="{url}/vault" style="color:black">Vault</a></li>                        <li class=" last"><a href="{url}/rotw" style="color:black">ROTW</a></li>                                        <li class="selected">Rum Models</li>                                                        </ul>                </div>            </div>            <div id="container">                         <div id="container">             <div id="container">                <div id="content" style="position: relative" class="clearfix">                    <div id="column1" class="column">                        <div class="habblet-container ">                            <div class="cbb clearfix darkred ">                                <h2 class="title">Rum models</h2>                                <div style="padding:7px 7px 1px" align = "center">                                    <?php                                        // Model 1                                        if(isset($_POST['model_1'])){                                            $amount = 0; //amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '0' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 1', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_1', '', '0', '', '10', '0', '2', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }                                                                                // Model 2                                        if(isset($_POST['model_2'])){                                            $amount = 5000; //amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '5000' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 2', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_2', '', '0', '', '1', '0', '', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }                                                                                if(isset($_POST['model_3'])){                                            $amount = 5000; //amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '5000' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 3', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_3', '', '0', '', '1', '0', '', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }                                                                                        else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }                                                                                if(isset($_POST['model_4'])){                                            $amount = 5000; //amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '5000' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 4', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_4', '', '0', '', '1', '0', '', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }                                                                                        else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }
                                            
    if(isset($_POST['model_5'])){                                            $amount 5000//amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '5000' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 5', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_5', '', '0', '', '1', '0', '', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }                                                                                        else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }                                                                                if(isset($_POST['model_6'])){                                            $amount = 5000; //amount of credits.                                            $q = mysql_query("SELECT null FROM users WHERE credits >= '{$amount}' AND id = '{$_SESSION['user']['id']}' LIMIT 1")or die(mysql_error());                                            if(mysql_num_rows($q) > 0) {                                                    mysql_query("UPDATE users SET credits = credits - '5000' WHERE username = '{$_SESSION['user']['username']}'");                                                    mysql_query("INSERT INTO `rooms` (`id`, `roomtype`, `caption`, `owner`, `description`, `category`, `state`, `users_now`, `users_max`, `model_name`, `public_ccts`, `score`, `tags`, `icon_bg`, `icon_fg`, `icon_items`, `password`, `wallpaper`, `floor`, `landscape`, `allow_pets`, `allow_pets_eat`, `allow_walkthrough`, `allow_hidewall`, `wallthick`, `floorthick`, `achievement`) VALUES (NULL, 'private', 'Købt rum - Model 6', '{$_SESSION['user']['username']}', 'Tillykke med dit nye rum! Købt for {$amount} mønter!', '0', 'open', '0', '25', 'model_koeb_6', '', '0', '', '1', '0', '', '', '0.0', '0.0', '0.0', '1', '0', '0', '0', '0', '0', '0')");                                                    echo '<div class = "alert-g">Sådan! Nu skal du blot reload hotellet, så er dit rum der!</div>';                                                    sendMUS('update_navigator');                                            }                                                                                        else{                                                echo "<div class = \"alert\">Du skal have {$amount} diamanter. Køb flere ved at <a href = '{url}/diamanter'>klikke her</a></div>";                                            }                                        }                                                                                if(isset($_POST['model_null'])){                                            echo "<div class = \"alert\">This is a null field, you cannot purchase this type.</div>";                                        }
                                        
    ?>                                    <style>                                        .image-viewer{                                            height:200px;                                            width:200px;                                            border-radius:4px;                                        }                                                                                .image-viewer img{                                            height:150px;                                            width:250px;                                            margin-top:28px;                                            margin-left:-30px;                                            border-radius:4px;                                        }                                                                                input[type='submit']{                                            height:25px;                                            border:1px solid lightgrey;                                            width:250px;                                            margin-left:-12px;                                            background-color:#fff;                                            font-weight:700;                                        }                                                                                input[type='submit']:hover{                                            text-decoration:underline;                                        }                                                                            </style>                                    <form method = "post">                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/x7EGSJw.png">                                                    <img src = "http://i.imgur.com/x7EGSJw.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_1" value = "Få dette rum GRATIS!"><br><b>Størrelse:</b> 32x32<br><b>Koster:</b> GRATIS<br><b>Udløber:</b> 05/09-2014 kl 18:00<br><br>                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/9Aka9Ev.png">                                                    <img src = "http://i.imgur.com/9Aka9Ev.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_2" value = "Køb dette rum!"><br><b>Størrelse:</b> 24x40<br><b>Koster:</b> 5000 mønter<br><br>                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/jqAkQn4.png">                                                    <img src = "http://i.imgur.com/jqAkQn4.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_3" value = "Køb dette rum!"><br><b>Størrelse:</b> 27x22<br><b>Koster:</b> 5000 mønter<br><br>                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/rr9JGiy.png">                                                    <img src = "http://i.imgur.com/rr9JGiy.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_4" value = "Køb dette rum!"><br><b>Størrelse:</b> 20x20<br><b>Koster:</b> 5000 mønter<br><br>                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/6284Gud.png">                                                    <img src = "http://i.imgur.com/6284Gud.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_5" value = "Køb dette rum!"><br><b>Størrelse:</b> 20x25<br><b>Koster:</b> 5000 mønter<br><br>                                            <div class = "image-viewer">                                                <a href = "http://i.imgur.com/OLMFrd9.png">                                                    <img src = "http://i.imgur.com/OLMFrd9.png">                                                </a>                                            </div>                                        <input type = "submit" name = "model_6" value = "Køb dette rum!"><br><b>Størrelse:</b> 15x30<br><b>Koster:</b> 5000 mønter<br>                                    </form>                                </div>                            </div>                        </div>                    </div>                    <style>                        .alert-box{                            height:40px;                            width:301px;                            background-color:lightgreen;                            margin-bottom:5px;                            border-radius:3px;                            text-align:center;                            font-size:10px;                            color:#fff;                            font-weight:700;                            line-height:38px;                        }                                            </style>                    <div id="column2" class="column">                        <div class="habblet-container ">                            <div class="cbb clearfix blue ">                                <h2 class="title">Flere rum</h2>                                <div  align = "center" style="padding:7px 7px 1px">                                    <div class = "alert-box" style = "width:95%;">                                        Kommer snart                                    </div>                                </div>                            </div>                        </div>                    </div>                    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>                </div>                        <div id="footer" >            <?php include('includes/checktheban.php'); ?>            <?php include('includes/footer.php'); ?>        </div>        </body></html>
    And here is the page i'm trying to get working...
    PHP Code:
    <?php    function sendMUS($header$data){        $ip "127.0.0.1";        $port 30001;        $musData $header chr(1) . $data;        $sock =  [MENTION=1333431411]Socket[/MENTION]_create(AF_INETSOCK_STREAMgetprotobyname('tcp'));      [MENTION=1333431411]Socket[/MENTION]_connect($sock$ip$port);      [MENTION=1333431411]Socket[/MENTION]_send($sock$musDatastrlen($musData), MSG_DONTROUTE);      [MENTION=1333431411]Socket[/MENTION]_close($sock);    }?><?php$ltd_id preg_replace('/[^0-9]/'''$_POST["ltd_id"]);$user_id $_SESSION['user']['id'];$selectfromusers mysql_query("SELECT * FROM users WHERE id = '".$user_id."'") or die(mysql_error());while ($getmoney mysql_fetch_array($selectfromusers))$money_current $getmoney['credits'];$selectfromfurninum mysql_query("SELECT * FROM rev_ltd WHERE furni_id = '".$ltd_id."'") or die(mysql_error());while ($getfurninum mysql_fetch_array($selectfromfurninum))$furnileft $getfurninum['furni_left'] and$furnisold $getfurninum['furni_sold'] and$ltd_price $getfurninum['furni_price'];if($furnileft '0'){if($money_current $ltd_price){echo "You don't have enough money for this item";}else{$newmoney $money_current $ltd_price;mysql_query("UPDATE users SET credits='".$newmoney."' WHERE id='".$user_id."'") or die(mysql_error());$newfurnileft $furnileft '1';$newfurnisold $furnisold '1';mysql_query("UPDATE rev_ltd SET furni_sold='".$newfurnisold."'") or die(mysql_error());mysql_query("UPDATE rev_ltd SET furni_left='".$newfurnileft."'") or die(mysql_error());$highestid mysql_query("SELECT * from items ORDER BY id DESC LIMIT 1") or die(mysql_error());while ($checknewid2 mysql_fetch_array($highestid))$newid2 $checknewid2['id'];$newid $newid2 '1';mysql_query("INSERT INTO items (id, user_id, room_id, base_item, x, y, z, rot, wall_pos) VALUES ('".$newid."','".$user_id."',0,'".$ltd_id."',0,0,0,0,0)") or die(mysql_error());echo "Item bough successfully!";}}else{echo "All of furniture is already sold, sorry";}?><meta http-equiv="refresh" content="5; URL=me">´
    (Please copy all of it into notepad++ if it is.

    Can anyone help me? Will give a like and credits.

    Thanks,
    Mathias




Advertisement