You're putting a lot of effort in this project. Its one of the best projects I've seen so far. Good Luck with itmaybe.
Update:
Automatic Logout coded
Gang Bots coded
Gang Bots will only attack if your gang is not neutral or if you're claiming their turf
XP now caches
Taxi now delays depending on your rank/job
Bots can now arrest other bots or even fight other bots
Bots/Pets can now follow their master through rooms
Bots/Pets will defend their master if they are attacked by users or a bot
Gates now automatically open when you're in front of them
Gang bots can now walk through arrows/teleporter
credits goes to sledmore, got the idea from v26 rps.
Code:public void Taxi(int RoomId) { RoomUser roomUser = CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Id); if (Jailed > 0 || Dead > 0 || roomUser.Stunned || dubCooldown > 0) Responds(); else { if (TaxiDest > 0 && TaxiTime > 0) return; using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("SELECT * FROM rooms WHERE id = " + RoomId + ""); DataTable dbTable = dbClient.getTable(); foreach (DataRow Row in dbTable.Rows) { if (Convert.ToInt32(Row[0]) > 0) { dubCooldown = 7; CurrentRoom.SendMessage(new ShoutComposer(roomUser.VirtualId, "*calls for a taxi to " + Convert.ToString(Row[2]) + " [" + Convert.ToInt32(Row[0]) + "]*", 0, roomUser.LastBubble)); TaxiDest = Convert.ToInt32(Row[0]); if (Rank == 1) TaxiTime = SilverwaveEnvironment.GetRandomNumber(40, 80); else if (Rank > 1 || Job == 1 && Working) TaxiTime = SilverwaveEnvironment.GetRandomNumber(20, 30); } } } } }
This is fucking nice, but how about the Police BOTs? If I want to be a COP myself is that possible? Maybe a function to turn off Police BOTs and make it that if its on "0" you can me a COP by joining a group... like the government.
DataRow Row = null;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT `id`,`caption` FROM `rooms` WHERE `id` = '" + RoomId + "' LIMIT 1");//LIMIT to 1 row, and only fetch what we need - runs quicker.
Row = dbClient.getRow();
}
if (Row == null)
{
//Oops, no record found.
return;
}
dubCooldown = 7;
TaxiDest = Convert.ToInt32(Row["id"]);
CurrentRoom.SendMessage(new ShoutComposer(roomUser.VirtualId, "*calls for a taxi to " + Convert.ToString(Row["caption"]) + " [" + Convert.ToInt32(Row["id"]) + "]*", 0, roomUser.LastBubble));
//A ternary operator can avoid the conditional statement, it does the same thing, but can look prettier!
TaxiTime = (Rank > 1 || Job == 1 && Working ? PlusEnvironment.GetRandomNumber(20, 30) : PlusEnvironment.GetRandomNumber(40, 80));
Hmmm kay. But everything seems really nice for then (sorry for my bad English I'm Dutch!!!)It's all up to the owner's preference to either have Police Bots take full control but what I currently have it set to, the Police Bots will only patrol if regulars cops are off duty.
Looks a good, just a few suggestions/points.
In your Startwork command and DeadSetup methods you don't do anything with the ServerMessages. In your Taxi command you do not need to run a forearch and create a DataRow, you could start off with that, such as;
Code:DataRow Row = null; using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("SELECT `id`,`caption` FROM `rooms` WHERE `id` = '" + RoomId + "' LIMIT 1");//LIMIT to 1 row, and only fetch what we need - runs quicker. Row = dbClient.getRow(); } if (Row == null) { //Oops, no record found. return; } dubCooldown = 7; TaxiDest = Convert.ToInt32(Row["id"]); CurrentRoom.SendMessage(new ShoutComposer(roomUser.VirtualId, "*calls for a taxi to " + Convert.ToString(Row["caption"]) + " [" + Convert.ToInt32(Row["id"]) + "]*", 0, roomUser.LastBubble)); //A ternary operator can avoid the conditional statement, it does the same thing, but can look prettier! TaxiTime = (Rank > 1 || Job == 1 && Working ? PlusEnvironment.GetRandomNumber(20, 30) : PlusEnvironment.GetRandomNumber(40, 80));
Just a couple of suggestions that will benefit quite nicely during runtime.
Also, nice to see you're making use of the notifications.
The "RoomUpdate.AppendString(Motto);" uses the servermessage. ye, I already removed the "for each" because I don't need to select everything from the rooms database, just what I need. thanks.
What's the point? where is the emulator suppose to get the room's id and name? from it's ass? unless you actually know what you're talking about, please shut the fuck up. You just probably learned what a query is, if you wanna make subjective criticism, take a look at your hotel *coughs* rage.What's the point of using a query for Taxi Command? ;S
What's the point? where is the emulator suppose to get the room's id and name? from it's ass? unless you actually know what you're talking about, please shut the fuck up. You just probably learned what a query is, if you wanna make subjective criticism, take a look at your hotel *coughs* rage.
if (Room.RoomData.TaxiEnabled)
{
//Do something.
}
if (Room.TaxiEnabled)
{
//Do something.
}
Quite aggressive? There is no point in using a query for the taxi command, as plus emulator caches room data in the Room.cs class.What's the point? where is the emulator suppose to get the room's id and name? from it's ass? unless you actually know what you're talking about, please shut the fuck up. You just probably learned what a query is, if you wanna make subjective criticism, take a look at your hotel *coughs* rage.
No point but no RP emulator never uses queries for a taxi command.. Even Reality doesn't use queries for it so yeah.What's the point? where is the emulator suppose to get the room's id and name? from it's ass? unless you actually know what you're talking about, please shut the fuck up. You just probably learned what a query is, if you wanna make subjective criticism, take a look at your hotel *coughs* rage.
Craig that was aggressive!!!
What was the taxi command?
TaxiTime = (Rank > 1 || Job == 1 && Working ? PlusEnvironment.GetRandomNumber(20, 30) : PlusEnvironment.GetRandomNumber(40, 80)); ?? Thats a Timer?
How do you use Seconds--; ?
and its frozen?seems awesome, looking forward for this, I just wish that the dev. doesnt freeze