This is my first ever work in C#. It's not exactly advanced geophysics, but it's pretty handy. There are two gates in this, MOD and ADM. Your white gate will be for Moderators, and your yellow will be for Administrators. The MOD gate will only allow Rank 6 or above. The ADM gate will only allow Rank 7 or above. This was made for RastaLulz's RP Emulator (Based on Dissi's Edit of Holo).
Instructions:
1. Open virtualUser.cs (.../Virtual/Users/virutalUser.cs)
2. Search "#region one way gate" without quotation marks.
3. Select the whole region and delete it.
4. Then add this region:
And you're done!Code:#region one way gate case "Ch": // Ch + ONE-WAY-DOOR-FURNI-ID (answer: Dx + WIRE(FURNI-ID) + I + WIRE(ROOM-UID-OF-CLICKER)) (sprite: 'one_way_door*#) { if (Room == null || roomUser == null || _inPublicroom) return; int itemID = Encoding.decodeVL64(currentPacket.Substring(2)); Rooms.Items.floorItem Item = Room.floorItemManager.getItem(itemID); // Find the item. try { if (Room.floorItemManager.containsItem(itemID) && stringManager.getStringPart(Item.Sprite, 0, 12) == "one_way_door") { if (Item.Sprite == "one_way_door*5") { int corp_id; int secure_id; int corphq; int userisarrested; int isworking; int global_job; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { corp_id = dbClient.getInt("SELECT corp_id FROM users WHERE name = '" + _Username + "'"); secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'"); isworking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'"); corphq = dbClient.getInt("SELECT room_id FROM jobs_rooms WHERE rank_id = '" + secure_id + "' && room_id = '" + _roomID + "'"); userisarrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'"); global_job = dbClient.getInt("SELECT global FROM jobs_ranks WHERE id = '" + secure_id + "'"); } if (corphq != _roomID && corp_id != 1) { sendData("BK" + "Sorry, but you must work here to enter this area."); return; } if (isworking == 0) { sendData("BK" + "You must have started work to enter."); return; } } if (Item.Sprite == "one_way_door*3") { if (_Credits < 5) { sendData("BK" + "You must have atleast five credits on you to go through this gate."); return; } string roomOwner; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { roomOwner = dbClient.getString("SELECT owner FROM rooms WHERE id = '" + _roomID + "'"); dbClient.runQuery("UPDATE users SET credits = credits + '5' WHERE name = '" + roomOwner + "'"); dbClient.runQuery("UPDATE users SET credits = credits - '5' WHERE name = '" + _Username + "'"); } refreshValueables(true, false); sendData("BK" + "You have been charged 5 credits for your toll."); } if (Item.Sprite == "one_way_door*1") { int userisarrested; using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) { userisarrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'"); } if (userisarrested == 1) { return; } } if (Item.Sprite == "one_way_door*9") { if (_Rank < 2) { sendData("BK" + "Sorry, but you must purchase VIP to use this gate."); return; } } if (Item.Sprite == "one_way_door*8") { if (_Rank < 7) { sendData("BK" + "Sorry, but you must be an Administrator to use this gate."); return; } } if (Item.Sprite == "one_way_door*4") { if (_Rank < 6) { sendData("BK" + "Sorry, but you must be a Moderator to use this gate."); return; } } Room.sendData("Dx" + Encoding.encodeVL64(itemID) + "I" + Encoding.encodeVL64(Room.roomID)); // Opens the gate, with green light Room.setSquareState(Item.X, Item.Y, 1, 1, virtualRoom.squareState.Open); roomUser.walkLock = true; switch (Item.Z) // Walk into the item { case 0: roomUser.goalY = Room.sqSTATE[Item.X, Item.Y + 1] == virtualRoom.squareState.Blocked ? Item.Y : Item.Y + 1; roomUser.goalX = Item.X; break; case 2: roomUser.goalX = Room.sqSTATE[Item.X - 1, Item.Y] == virtualRoom.squareState.Blocked ? Item.X : Item.X - 1; roomUser.goalY = Item.Y; break; case 4: roomUser.goalY = Room.sqSTATE[Item.X, Item.Y - 1] == virtualRoom.squareState.Blocked ? Item.Y : Item.Y - 1; roomUser.goalX = Item.X; break; case 6: roomUser.goalX = Room.sqSTATE[Item.X + 1, Item.Y] == virtualRoom.squareState.Blocked ? Item.X : Item.X + 1; roomUser.goalY = Item.Y; break; case 8: roomUser.goalY = Room.sqSTATE[Item.X, Item.Y - 1] == virtualRoom.squareState.Blocked ? Item.Y : Item.Y - 1; roomUser.goalX = Item.X; break; case 10: roomUser.goalX = Room.sqSTATE[Item.X + 1, Item.Y] == virtualRoom.squareState.Blocked ? Item.X : Item.X + 1; roomUser.goalY = Item.Y; break; } roomUser.walkLock = false; while (true) if (roomUser.statusManager.containsStatus("mv")) break; Room.sendData("Dx" + Encoding.encodeVL64(itemID) + "H" + Encoding.encodeVL64(Room.roomID), 1000); Room.setSquareState(Item.X, Item.Y, 1, 1, virtualRoom.squareState.Blocked); break; } } catch { } break; } #endregion #endregion } #endregion } } #endregion
Also if you want the External_Texts for these gates they're below. (You might have to find the original External_Texts for the Yellow and White gates because they already exist!)
Code:furni_one_way_door*4_name=Moderator Entrance furni_one_way_door*4_desc=This gate only allows Moderators through. furni_one_way_door*8_name=Administrator Entrance furni_one_way_door*8_desc=This gate only allows Administrators through.
Comments?![]()


![[RP] Staff One-Way-Gates](http://ragezone.com/hyper728.png)



