Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
[RP] :timeleft Glitch Logout
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JayC" data-source="post: 356510" data-attributes="member: 36373"><p>Here you go <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /> Thanks in advance for taking the time to look at it Westyy!</p><p></p><p>[CODE]</p><p>#region :startwork</p><p> case "startwork":</p><p></p><p> #region cw</p><p> //games</p><p> if (Session.CharacterInfo.inCw == true)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "Cannot do this in Color Wars", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p> #endregion</p><p></p><p> if (Session.CharacterInfo.Energy < 5)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "You're don't have enough energy to work grab a snack and refresh yourself!", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p></p><p> if (Session.CharacterInfo.SentHome == 1)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, Your manager/supervisor has sent you home!", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p> if (Session.CharacterInfo.Working == 1)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "You're already working!", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p> if (Session.CharacterInfo.Dead == 1)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, You're dead!", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p></p><p> if (Session.CharacterInfo.Jailed == 1)</p><p> {</p><p> Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, You're jailed!", 0, ChatType.Whisper));</p><p> return true;</p><p> }</p><p> using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())</p><p> {</p><p> MySqlClient.SetParameter("groupid", Session.CharacterInfo.GroupID);</p><p> DataRow Row1 = MySqlClient.ExecuteQueryRow("SELECT * FROM groups_details WHERE id = @groupid");</p><p> MySqlClient.SetParameter("userid", Session.CharacterInfo.Id);</p><p> DataRow Row2 = MySqlClient.ExecuteQueryRow("SELECT * FROM users WHERE id = @userid");</p><p> MySqlClient.SetParameter("groupid", Session.CharacterInfo.GroupID);</p><p> MySqlClient.SetParameter("rankid", Row2["jobrank"]);</p><p> DataRow Row3 = MySqlClient.ExecuteQueryRow("SELECT * FROM jobranks WHERE jobid = @groupid AND rankid = @rankid");</p><p> int room_id = (int)Row1["roomid"];</p><p> string jobname = (string)Row1["name"] + " " + (string)Row3["name"];</p><p> string jobfig = (string)Row3["figure_data_" + Session.CharacterInfo.Gender.ToString()];</p><p> int paytime = (int)Row3["paytime"];</p><p></p><p> if (room_id == Instance.RoomId || room_id == 0)</p><p> {</p><p> string figure_update = FigToUniFig(Session.CharacterInfo.Figure) + jobfig;</p><p> if (jobfig == "")</p><p> {</p><p> figure_update = Session.CharacterInfo.Figure;</p><p> }</p><p> if (Session.CharacterInfo.Timer < 1 || Session.CharacterInfo.Timer > paytime)</p><p> {</p><p> Session.CharacterInfo.Timer = paytime;</p><p> }</p><p> Instance.BroadcastMessage(UserInfoUpdateComposer.Compose(Actor.Id, figure_update, Session.CharacterInfo.Gender, "[WORKING] " + jobname, Session.CharacterInfo.Score));</p><p> Instance.BroadcastMessage(RoomChatComposer.Compose(Actor.Id, "*Starts to work*", 0, ChatType.Shout));</p><p> Session.CharacterInfo.UpdateLearning(MySqlClient, 0);</p><p> Session.CharacterInfo.UpdateWorking(MySqlClient, 1);</p><p> Session.CharacterInfo.StartTimer("work", Session);</p><p></p><p> }</p><p> }</p><p> return true;</p><p> #endregion[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 356510, member: 36373"] Here you go :) Thanks in advance for taking the time to look at it Westyy! [CODE] #region :startwork case "startwork": #region cw //games if (Session.CharacterInfo.inCw == true) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "Cannot do this in Color Wars", 0, ChatType.Whisper)); return true; } #endregion if (Session.CharacterInfo.Energy < 5) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "You're don't have enough energy to work grab a snack and refresh yourself!", 0, ChatType.Whisper)); return true; } if (Session.CharacterInfo.SentHome == 1) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, Your manager/supervisor has sent you home!", 0, ChatType.Whisper)); return true; } if (Session.CharacterInfo.Working == 1) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "You're already working!", 0, ChatType.Whisper)); return true; } if (Session.CharacterInfo.Dead == 1) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, You're dead!", 0, ChatType.Whisper)); return true; } if (Session.CharacterInfo.Jailed == 1) { Session.SendData(RoomChatComposer.Compose(Actor.Id, "You cant work, You're jailed!", 0, ChatType.Whisper)); return true; } using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient()) { MySqlClient.SetParameter("groupid", Session.CharacterInfo.GroupID); DataRow Row1 = MySqlClient.ExecuteQueryRow("SELECT * FROM groups_details WHERE id = @groupid"); MySqlClient.SetParameter("userid", Session.CharacterInfo.Id); DataRow Row2 = MySqlClient.ExecuteQueryRow("SELECT * FROM users WHERE id = @userid"); MySqlClient.SetParameter("groupid", Session.CharacterInfo.GroupID); MySqlClient.SetParameter("rankid", Row2["jobrank"]); DataRow Row3 = MySqlClient.ExecuteQueryRow("SELECT * FROM jobranks WHERE jobid = @groupid AND rankid = @rankid"); int room_id = (int)Row1["roomid"]; string jobname = (string)Row1["name"] + " " + (string)Row3["name"]; string jobfig = (string)Row3["figure_data_" + Session.CharacterInfo.Gender.ToString()]; int paytime = (int)Row3["paytime"]; if (room_id == Instance.RoomId || room_id == 0) { string figure_update = FigToUniFig(Session.CharacterInfo.Figure) + jobfig; if (jobfig == "") { figure_update = Session.CharacterInfo.Figure; } if (Session.CharacterInfo.Timer < 1 || Session.CharacterInfo.Timer > paytime) { Session.CharacterInfo.Timer = paytime; } Instance.BroadcastMessage(UserInfoUpdateComposer.Compose(Actor.Id, figure_update, Session.CharacterInfo.Gender, "[WORKING] " + jobname, Session.CharacterInfo.Score)); Instance.BroadcastMessage(RoomChatComposer.Compose(Actor.Id, "*Starts to work*", 0, ChatType.Shout)); Session.CharacterInfo.UpdateLearning(MySqlClient, 0); Session.CharacterInfo.UpdateWorking(MySqlClient, 1); Session.CharacterInfo.StartTimer("work", Session); } } return true; #endregion[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[RP] :timeleft Glitch Logout
Top