[Request] Fixing this command error.[Request]

Al-Santoro

New Member
Jan 20, 2011
29
5
Information:
Right, first, I've made a new suicide command which can make you die instinctively, and makes you lose 200 credits (So people won't do it so often), and you automatically get sent to the hospital.. Not sure if the rest of the features works, but I've tried adding in where you can't use it when stunned, dead, or arrested.. However, when I tried adding that in, it came up with errors.. However, if any of you want, you could try to help me with this command ? ;]

Code:
#region :die
                    case "suicide":
                        {
                            using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                            {
                                dbClient.runQuery("UPDATE user SET health = health = - '100' WHERE name = '" + _Username + "'");
                                dbClient.runQuery("UPDATE user SET credits = credits - '200' WHERE name = '" + _Username + "'");
                                {
                                if (roomUser.walkLock == true)
                                            {
                                                sendData("BK" + "Nice try, but you are either stunned or cuffed.");
                                            }
                                            else
                                            {
                                                int isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
                                                if (isArrested == 1)
                                                {
                                                    Room.sendWhisper(roomUser, _Username, "Sorry, but you can't suicide when arrested.");
                                                }
                                                else
                                                {
                                                    int isDead = dbClient.getInt("SELECT dead FROM users WHERE name = '" + _Username + "'");
                                                    if (isDead == 1)
                                                    {
                                                        Room.sendWhisper(roomUser, _Username, "Sorry, but you can't suicide when you're dead.");
                                                    }
                                                   
                                Room.sendSaying(roomUser, "*Takes out their pocket knife and slits their throat, causing suicide!*");
                                Room.sendSaying(roomUser, "*The ambulance successfully finds the body and returns the body to the hospital.*");
                                sendData("BK" + "You've just caused suicide and lost 200cs! We pray for you. ;[");
                                _Mission = "[Dead]Committed Suicide!";
                                refreshAppearance(false, true, true);
                            }
                        }
                        break;
                    #endregion

Hopefully someone is able to help out. ;]
 

Users who are viewing this thread

Top