[Rel] [Harsh] Hospital Calls [Harsh]

Status
Not open for further replies.

Harsh

New Member
Jun 18, 2010
46
1
Ok Here it goes:

1. Open usermanager.cs in Source>Managers>usermanager.cs
2. Search 'SendToCop' (with no quotes)
3. Underneath that add:
Code:
public static void sendToDoc(int getCorp, bool includeHigher, string Data)
        {
            try
            {
                {
                    foreach (virtualUser User in _Users.Values)
                    {
                        int getWorking;
                        using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                        {
                            getCorp = dbClient.getInt("SELECT corp_id FROM users WHERE name = '" + User._Username + "'");
                            getWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + User._Username + "'");
                        }
                        if (getCorp == 2 && getWorking == 1)
                        {
                            User.sendData(Data);
                        }
                    }
                }
            }
            catch { }
        }

4. Now open up virtualuser.cs,and search :911.
5. Underneath :911 add:
Code:
#region :411 <message>
                    case "411":
                        {
                            if (copCdLooper != null)
                            {
                                sendData("BK" + "Sorry, but you have to wait to send another 911 call.");
                            }
                            else
                            {
                                int isArrested;
                                int copID;
                                using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                {
                                    isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
                                    copID = dbClient.getInt("SELECT id FROM police_call");
                                }
                                if (isArrested == 0)
                                {
                                    string cfhMessage = Text.Substring(3);
                                    Room.sendSaying(roomUser, "*calls the hospital for help*");
                                    userManager.sendToDoc(1, false, "BK" + "Caller: " + _Username + "\rMessage: " + cfhMessage + "\rRoom ID: " + _roomID);

                                }
                            }
                            break;
                        }
                    #endregion

6. If You want to replace your heal command with this, all this does is if you create a corp and a rank to work in any room for the :411 help, this will allow it.
Code:
#region :heal <user>
                    case "heal":
                        {
                            if(cdLooper != null)
                            {
                                Room.sendWhisper(roomUser, _Username, "(cooldown)");
                                
                                {                           
                                
                                    virtualUser User = userManager.getUser(args[1]);
                                    if ((roomUser.Y == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X))
                                    {
                                        int getHealth;
                                        int canHeal;
                                        int getJob;
                                        using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                        {
                                            getJob = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
                                            canHeal = dbClient.getInt("SELECT heal FROM jobs_ranks WHERE id = '" + getJob + "'");
                                            getHealth = dbClient.getInt("SELECT health FROM users WHERE name = '" + args[1] + "'");
                                        }
                                        if (canHeal == 1)
                                        {
                                            ThreadStart cdStarter = new ThreadStart(coolDown);
                                            cdLooper = new Thread(cdStarter);
                                            cdLooper.Priority = ThreadPriority.Lowest;
                                            cdLooper.Start();
                                            if (getHealth > 50)
                                            {
                                                using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                                {
                                                    dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + args[1] + "'");
                                                    Room.sendSaying(roomUser, "*heals " + args[1] + "*");
                                                }
                                            }
                                            else
                                            {
                                                using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                                                {
                                                    dbClient.runQuery("UPDATE users SET health = health + 50 WHERE name = '" + args[1] + "'");
                                                }
                                                Room.sendSaying(roomUser, "*heals " + args[1] + "*");

                                            }
                                        }
                                    }
                                }
                            }
                            break;
                        }
                    #endregion

Enjoy, Feel free to press the Thanks button :)
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
I don't really like it, But nice release. Just the fact people would abuse it. Just make it so they cannot heal them selfs? When out?
 

FL4

Member
Sep 19, 2010
452
29
no because then thay can't play again unless it takes 1 hour to heal
 

Li1M0ST3Rz

I <3 Bianca
Sep 13, 2010
269
166
why don't you add
if(_Health == 100) { Room.sendShout(roomUsers, "sorry but nice try trying to do it again you failed.", true); { else
etc.
that will be good if users trying to use it more then one.
 
Status
Not open for further replies.

Users who are viewing this thread

Top