10 Minute function, don't expect it to be perfect.
Room Advertisements
Advertisement command!
Room Enter Function
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
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
- message[vachar(50)]
- alert[int(1)]