• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[rp] ic/ooc function

Status
Not open for further replies.
Newbie Spellweaver
Joined
Aug 19, 2008
Messages
98
Reaction score
11
Hey!

Here is my IC/OOC function!

COMMAND:
Code:
#region IC/OOC
                    case "ooc":
                        {
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                dbClient.runQuery("UPDATE users SET ooc = '1' WHERE id = '" + userID + "'");
                            }

                            break;
                        }
                    case "ic":
                        {
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                dbClient.runQuery("UPDATE users SET ooc = '0' WHERE id = '" + userID + "'");
                            }
                            
                            break;
                        }
                    #endregion

Then, SEARCH for:
Code:
                                    Message = stringManager.filterSwearwords(Message);

Under that place this (MAKE SURE ITS IN THE SHOUT/SAY SECTION!):
Code:
                                    string TALKCHECK;
                                    using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                    {
                                        TALKCHECK = dbClient.getString("SELECT ooc FROM users where id = '" + userID + "'");
                                    }
                                    if (TALKCHECK == "1" && Message != ":ic")
                                    {
                                        Message = "[ " + Message + " ]";
                                    }

Also, add a column to users named "ooc" [int 1] with a default value of 0.

Enjoy!
 
Custom Title Activated
Loyal Member
Joined
Oct 21, 2007
Messages
2,098
Reaction score
464
Nice Swimo I'll Test It out Later >.<
 
Status
Not open for further replies.
Back
Top