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
how to get a coords via code
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: 438707" data-attributes="member: 36373"><p>This is a very bad way to code this (In reference to how you determine if it is a game room)</p><p></p><p>Create a table called "<strong>rooms_events</strong>"</p><p>Columns should be:</p><p><strong>room_id INT 11 0 Primary Key</strong></p><p><strong>x_tile INT 11 0 DEFAULT 0</strong></p><p><strong>y_tile INT 11 0 DEFAULT 0</strong></p><p><strong>active INT 11 0 DEFAULT 1</strong></p><p><strong></strong></p><p>You then should create an object called something along the lines of "RoomEvent.cs" and it should contain the data roomId, intX, intY and Active</p><p></p><p>Then create a method inside of Game.cs and load all of the database entries into a Dictionary. Then reference that dictionary based on the room ID and it will return the RoomEvent object</p><p></p><p>So the code will be almost like:</p><p></p><p>RoomEvent event = PlusEnvironment.GetGame().GetRoomEventByRoomId(1);</p><p></p><p>if(event == null)</p><p>//No Event Found</p><p></p><p>if(!event.active)</p><p>//No Active Event</p><p></p><p>event.intX = X Tile</p><p>event.intY = Y Tile</p></blockquote><p></p>
[QUOTE="JayC, post: 438707, member: 36373"] This is a very bad way to code this (In reference to how you determine if it is a game room) Create a table called "[B]rooms_events[/B]" Columns should be: [B]room_id INT 11 0 Primary Key x_tile INT 11 0 DEFAULT 0 y_tile INT 11 0 DEFAULT 0 active INT 11 0 DEFAULT 1 [/B] You then should create an object called something along the lines of "RoomEvent.cs" and it should contain the data roomId, intX, intY and Active Then create a method inside of Game.cs and load all of the database entries into a Dictionary. Then reference that dictionary based on the room ID and it will return the RoomEvent object So the code will be almost like: RoomEvent event = PlusEnvironment.GetGame().GetRoomEventByRoomId(1); if(event == null) //No Event Found if(!event.active) //No Active Event event.intX = X Tile event.intY = Y Tile [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
how to get a coords via code
Top