[r63] User Room Advertising [For Holograph]

Status
Not open for further replies.

Tr0ll.

Member
Nov 20, 2010
99
5
10 Minute function, don't expect it to be perfect.

Room Advertisements

Advertisement command!
PHP:
#region :ad <type> <message>
                    case "ad": // An Uber Function!
                        {
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                string type = args[1];
                                string message = args[2];
                                //N00BT00B3R
                                {
                                    if (type != "1" || type != "2")
                                    {
                                        sendData("BK" + "You must either say '1'(user whisper message) or '2'(user gets a alert)");
                                    }
                                }
                                //END N00BT00B3R    
                                {
                                    string owner;
                                    {
                                        owner = dbClient.getString("SELECT owner FROM rooms WHERE id = '" + _roomID + "'");
                                    }

                                    if (_Username == "owner")
                                    {
                                        dbClient.runQuery("UPDATE rooms SET alert = '" + type + "' WHERE id = '" + _roomID + "'");
                                        dbClient.runQuery("UPDATE rooms SET message = '" + message + "' WHERE id = '" + _roomID + "'");
                                    }
                                }
                            }
                            break;
                        }
                    #endregion

Room Enter Function
PHP:
                        case "A@": // Enter room - add this user to room
                            {
                                if (_ROOMACCESS_SECONDARY_OK && Room != null && roomUser == null)
                                {
                                    sendData("@b" + Room.dynamicStatuses);
                                    Room.addUser(this);
                                    if (Room.hasSpecialCasts("cam1"))
                                    {
                                        sendData("AGcam1 targetcamera " + roomUser.roomUID);
                                    }
                                }
                                {
                                    using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                    {
                                        int ad = dbClient.getInt("SELECT alert FROM rooms WHERE id = '" + _roomID + "'");
                                        if (ad != 0)
                                        {
                                            string message = dbClient.getString("SELECT message FROM rooms WHERE id = '" + _roomID + "'");
                                            if (ad == 1)
                                            {
                                                Room.sendWhisper(roomUser, _Username, "*" + message + "*");
                                            }
                                            if (ad == 2)
                                            {
                                                sendData("BK" + "" + message + "");
                                            }
                                        }
                                    }
                                }
                                break;
                            }

This will basically let the user define an advertisement for their room. I don't know if that was actually in Uber.. But I've seen it on the Original .COM itself. I was rushing when coding this, if you find any errors don't fret and just tell me!.

Thanks is always appreciated.

Database Work
In teh Table 'Rooms'
Make 2 Columns
  1. message[vachar(50)]
  2. alert[int(1)]
 

Tr0ll.

Member
Nov 20, 2010
99
5
This is an r63 Function, You will see it in popular rooms on

I coded this for Holograph, I could also code it for Uber.

If you needed.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Nice, I really don't know any flash holograph's though, only some unstable R42 and R46. Thanks for this anyways, hopefully someone will find it useful.
 

Tr0ll.

Member
Nov 20, 2010
99
5
No, No, No

This works for any version of habbo. that Holograph is for v26 ect.

All this does is lets the user define an alert for an user when they go to that certain room.
 

Tr0ll.

Member
Nov 20, 2010
99
5
"Other Forums" didn't have any replies so i decided to post here.

I'm going to Re-Code This a bit to make it cleaner.
 
Status
Not open for further replies.

Users who are viewing this thread

Top