Have U Pasted It In "Room Actions"
Printable View
Have U Pasted It In "Room Actions"
You mean "In-room actions? If so then yes.
Give me a list of errors :)
Code a New Stat Like Intelligence, With the Command :learn
Here are the errors:
http://i29.tinypic.com/ay51qq.png
go to sqstate error And right click then press go to definatioon <-- Spelled wrong :P And for toll and owner click Generate Method stub or anything for all others do the same as toll
When I do extract method it says "The type of expression could not be determined."
Edit: Okay fixed the problem above. Now there's a problem with the refreshValueables, saying 'int' does not contain a definition for refreshValueables...And so on. It's in the screenie above.
I dont get why you guys use that toll command. No offense but its crap. ATM i know how it works but i just need to get whats in my mind into my Emulator. Heres how it works.
They stand in front of the gate and type ":toll 100" and then it checks to see if the gates in front of the user. If it is it inserts into the database the userid, itemid and amount. When people want to go through the gate it checks to see if the gate has a toll. If it does it sends the Poll packet with the question and all that. When they click ok it pays the owner and they get through. Ive got it all working but i dont know how to make it so when the user clicks ok it continues with it.
SO if someone could help me with that il be more than happy to release it.
I can try to help you by what I see, but I've never even coded a command before in my life lol. I guess it's time for me to try.
Okay, I almost got the command working. It's just one error that I can't seem to fix.
This is how the code should look:
Insert this into it also:Code:case "Ch": // Ch + ONE-WAY-DOOR-FURNI-ID (answer: Dx + WIRE(FURNI-ID) + I + WIRE(ROOM-UID-OF-CLICKER)) (sprite: 'one_way_door*#)
{
if (Room == null || roomUser == null || _inPublicroom)
return;
int itemID = Encoding.decodeVL64(currentPacket.Substring(2));
Rooms.Items.floorItem Item = Room.floorItemManager.getItem(itemID); // Find the item.
try
{
if (Room.floorItemManager.containsItem(itemID) && stringManager.getStringPart(Item.Sprite, 0, 12) == "one_way_door")
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
string toll;
toll = dbClient.getString("SELECT toll FROM rooms WHERE id = '" + _roomID + "'");
string owner;
owner = dbClient.getString("SELECT owner FROM rooms WHERE id = '" + _roomID + "'");
}
Room.sendData("Dx" + Encoding.encodeVL64(itemID) + "I" + Encoding.encodeVL64(Room.roomID)); // Opens the gate, with green light
Room.setSquareState(Item.X, Item.Y, 1, 1, virtualRoom.squareState.Open);
roomUser.walkLock = true;
switch (Item.Z) // Walk into the item
{
case 0: roomUser.goalY = Room.sqSTATE[Item.X, Item.Y + 1] == virtualRoom.squareState.Blocked ? Item.Y : Item.Y + 1; roomUser.goalX = Item.X; break;
case 2: roomUser.goalX = Room.sqSTATE[Item.X - 1, Item.Y] == virtualRoom.squareState.Blocked ? Item.X : Item.X - 1; roomUser.goalY = Item.Y; break;
case 4: roomUser.goalY = Room.sqSTATE[Item.X, Item.Y - 1] == virtualRoom.squareState.Blocked ? Item.Y : Item.Y - 1; roomUser.goalX = Item.X; break;
case 6: roomUser.goalX = Room.sqSTATE[Item.X + 1, Item.Y] == virtualRoom.squareState.Blocked ? Item.X : Item.X + 1; roomUser.goalY = Item.Y; break;
}
roomUser.walkLock = false;
while (true)
if (roomUser.statusManager.containsStatus("mv"))
break;
Room.sendData("Dx" + Encoding.encodeVL64(itemID) + "H" + Encoding.encodeVL64(Room.roomID), 1000);
Room.setSquareState(Item.X, Item.Y, 1, 1, virtualRoom.squareState.Blocked);
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET credits = credits - '" + toll + "' WHERE id = '" + userID + "'");
dbClient.runQuery("UPDATE users SET credits = credits + '" + toll + "' WHERE name = '" + owner + "'");
_User.refreshValueables(true, true);
}
break;
}
}
catch { }
break;
}
Code:internal int owner;
internal int toll;
internal int _User;
I Fixed That Gate Code Long Ago Its Not Hard 321olos I Would Help you Settaz Beut it Generates In Diffrent Places Wha Errors Left
Hey guys,
As you may know i have closed the development on my edit of an R35 Server as things in life have cropped up..
Quote from thread;
"Guys I'm sorry I'm too busy now with this stuff, lots of stuff in like just happened.. I will release good snippets, but if you really just wanna know, then i lost a really good friend today ;[ -cry.
I'm sorry to disappoint you with this. But with all that happening in life i may just as well close this for now!
Once again, I'm Sorry!"
Yeah, before you say anything, I am not lying, its not an excuse cause i'm lazy or anything...
Right anyway, a few commands ;').
Kiss:
NOTE: There is no timy on this, i asked aaron for help, he gave me simple help, but them i realized, i would have to code a function for it..PHP Code:#region :kiss x
case "kiss":// kiss the target
{
virtualUser User = userManager.getUser(args[1]);
if (_Username == User._Username)
sendData("Sorry but you cannot kiss your self ;[" + Convert.ToChar(2));
else
if (User._roomID == _roomID && (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))
{
this.Room.sendSaying(roomUser, "*kisses " + User._Username + "*");
Room.sendSaying(User.roomUser, "*Blushes*");
this.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(9));
this.Handler.ProcessPacket("Et" + Encoding.encodeVL64(9));
User.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(9));
User.Handler.ProcessPacket("Et" + Encoding.encodeVL64(9));
}
}
break;
#endregion
Now, Stunning them target gaining an effect (Like HabboRP.com)
Stun:
(I think that is the firy thingy not sure not tested)PHP Code:#region :stun <user> & :uncuff <user>
case "stun": // Freeze the specified user
{
int getJob;
int isWorking;
int getAuth;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
getJob = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
getAuth = dbClient.getInt("SELECT stun FROM jobs_ranks WHERE id = '" + getJob + "'");
}
virtualUser User = userManager.getUser(args[1]);
if (User._roomID == _roomID && (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) || (roomUser.Y + 2 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y - 2 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X + 2 == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X - 2 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y + 2 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y - 2 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y + 2 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y - 2 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X + 2 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X - 2 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X + 2 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X - 2 == User.roomUser.X) || (roomUser.Y + 2 == User.roomUser.Y && roomUser.X - 2 == User.roomUser.X) || (roomUser.Y - 2 == User.roomUser.Y && roomUser.X + 2 == User.roomUser.X) || (roomUser.Y + 2 == User.roomUser.Y && roomUser.X + 2 == User.roomUser.X) || (roomUser.Y - 2 == User.roomUser.Y && roomUser.X - 2 == User.roomUser.X))
{
if (getAuth > 0 && isWorking > 0)
{
int _userID = userManager.getUserID(args[1]);
virtualUser Target = userManager.getUser(_userID);
Target.roomUser.walkLock = true; // Freeze the user
Room.sendSaying(roomUser, "*reaches for stun gun and quickly stuns " + Target._Username + "*");
User.Handler.ProcessPacket("Et" + Encoding.encodeVL64(8));
}
}
break;
}
#endregion
Now, a new command for effects :').
A command to make the user able to buy effects, well use..
USE:
A command for Corp id 1 to use the police car..PHP Code:#region :use
case "use"://
{
string use = args[1];
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
if (use == "hoverboard")
{
Room.sendSaying(roomUser, "*pulls out their hoverboard*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(2));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(2));
}
if (use == "UFO")
{
Room.sendSaying(roomUser, "*pulls out their UFO*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(3));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(3));
}
if (use == "rocket")
{
Room.sendSaying(roomUser, "*pulls out their rocket*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(6));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(6));
}
}
}
break;
}
#endregion
command:
Theses are just EXTREMELY simple commands.. Dont flame ty.PHP Code:#region :usecar
case "usecar"://
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
int isDead = dbClient.getInt("SELECT dead FROM users WHERE name = '" + _Username + "'");
int isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
int users_corp_id = dbClient.getInt("SELECT corp_id FROM users WHERE name = '" + _Username + "'");
int users_job_rank = dbClient.getInt("SELECT job_rank FROM users WHERE name = '" + _Username + "'");
int users_secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
int isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
if (isWorking == 0)
{
sendData("You need to be working to get your car!" + Convert.ToChar(2));
}
else
if (users_corp_id == 1)
{
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(19));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(19));
}
}
break;
}
#endregion
If this helped you press the thanks button.. :')
(Also their is no timers on non of them, there simple ones from my old back ups :P..
(Also if anyone wants the :usecar command able for other cars and other users ask me il do it..)
Thanks.
I was bored. and thanks to SledMore i made some commands.
This is Basically a command for hospital workers or later emergency workers to "drive" to suicide victimsPHP Code:#region Medical Car
case "medcar"://
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
int isDead = dbClient.getInt("SELECT dead FROM users WHERE name = '" + _Username + "'");
int isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
int users_corp_id = dbClient.getInt("SELECT corp_id FROM users WHERE name = '" + _Username + "'");
int users_job_rank = dbClient.getInt("SELECT job_rank FROM users WHERE name = '" + _Username + "'");
int users_secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
int isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
if (isWorking == 0)
{
sendData("You need to be working to get your car!" + Convert.ToChar(2));
}
else
if (users_corp_id == 2)
{
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(20));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(20));
}
}
break;
}
#endregion
#endregion
This is a updated Hit Command, I haven't tested it outPHP Code:#region :punch <user>
case "punch":
case "hit":
case "swing":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
virtualUser User = userManager.getUser(args[1]);
if (roomUser.walkLock == true)
{
sendData("BK" + "Nice try, but you are either stunned or cuffed." + Convert.ToChar(2));
}
else
{
if (punchCdLooper != null)
{
Room.sendWhisper(roomUser, _Username, "*attempts to swing at " + User._Username + ", but is too exhausted*");
}
else
{
int isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
int canHit = dbClient.getInt("SELECT violence FROM rooms WHERE id = '" + _roomID + "'");
int isAfk = dbClient.getInt("SELECT afk FROM users WHERE name = '" + User._Username + "'");
if (isAfk == 1)
{
sendData("BK" + "Sorry, but this user is AFK." + Convert.ToChar(2));
}
else
{
if (isArrested < 1)
{
if (canHit == 1)
{
sendData("BK" + "Sorry, but this room has been declared a no fighting zone." + Convert.ToChar(2));
}
else
{
if (User._roomID == _roomID && (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))
{
//db queries
int myHealth = dbClient.getInt("SELECT health FROM users WHERE name = '" + User._Username + "'");
int str_mod = dbClient.getInt("SELECT str FROM users WHERE name = '" + _Username + "'");
//generates a random number
Random randNum = new Random();
int hit_dif_0 = randNum.Next(1, 3);
int hit_dif_1 = randNum.Next(1, 13);
//what a user hits
int hit = str_mod * hit_dif_0 + hit_dif_1;
int getHit = myHealth - hit;
if (getHit < 1 && _Username == User._Username)
{
sendData("BK" + "Sorry, but you can not knock yourself out." + Convert.ToChar(2));
}
else
{
dbClient.runQuery("UPDATE users SET health = health - '" + hit + "' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET hits = hits + 1 WHERE name = '" + _Username + "'");
int health_db_ko = dbClient.getInt("SELECT health FROM users WHERE name = '" + User._Username + "'");
Room.sendShout(roomUser, "*Swings at " + User._Username + ", causing " + hit + " damage*");
ThreadStart punchCdStarter = new ThreadStart(punchCoolDown);
punchCdLooper = new Thread(punchCdStarter);
punchCdLooper.Priority = ThreadPriority.Lowest;
punchCdLooper.Start();
//if the user has 0 or less helth left
if (health_db_ko < 1)
{
if (User._Mission == "[Game] Deathmatch" || User._Mission == "[Game] Brawl" || User._Mission == "Blue Team - Colour Wars!" || User._Mission == "Red Team - Colour Wars!" || User._Mission == "Green Team - Colour Wars!" || User._Mission == "Pink Team - Colour Wars!" || User._Mission == "[Game] Infection")
{
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the lobby*");
if (User._Mission == "[Game] Deathmatch")
{
if (_Mission == "[Game] Deathmatch")
{
dbClient.runQuery("UPDATE users SET game_dm = game_dm + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(1));
User.sendData("BK" + "Thank you for playing deathmatch." + Convert.ToChar(2));}
if (User._Mission == "[Game] Brawl")
{
if (_Mission == "[Game] Brawl")
{
dbClient.runQuery("UPDATE users SET game_brawl = game_brawl + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(1));
User.sendData("BK" + "Thank you for playing Brawl" + Convert.ToChar(2));
}
if (User._Mission == "[Game] Infection")
{
if (_Mission == "[Game] Infection")
{
dbClient.runQuery("UPDATE users SET game_infect = game_infect + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(1));
User.sendData("BK" + "Thank you for playing Infection." + Convert.ToChar(2));
}
if (User._Mission == "Blue Team - Colour Wars!" || User._Mission == "Red Team - Colour Wars!" || User._Mission == "Green Team - Colour Wars!" || User._Mission == "Pink Team - Colour Wars!")
{
if (_Mission == "Blue Team - Colour Wars!" || User._Mission == "Red Team - Colour Wars!" || User._Mission == "Green Team - Colour Wars!" || User._Mission == "Pink Team - Colour Wars!" )
{
dbClient.runQuery("UPDATE users SET game_cwar = game_cwar + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(1));
User.sendData("BK" + "Thank you for playing Colour Wars." + Convert.ToChar(2));
}
User.refreshAppearance(true, true, true);
dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + User._Username + "'");
}
else
{
User.sendData("D^" + "H" + Encoding.encodeVL64(168));
User.sendData("BK" + "You have been killed and sent to the Graveyard!" + Convert.ToChar(2));
Room.sendShout(roomUser, "*Kills" + args[1] + ", sending them to the graveyard*");
dbClient.runQuery("UPDATE users SET kills = kills + 1 WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET deaths = deaths + 1, dead = '1', time_dead = '10' WHERE name = '" + User._Username + "'");
User._Mission = "Dead";
User.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(13));
User.Handler.ProcessPacket("Et" + Encoding.encodeVL64(13));
refreshAppearance(true, true, true);
ThreadStart koStarter = new ThreadStart(User.knockOut);
User.deadLooper = new Thread(koStarter);
User.deadLooper.Priority = ThreadPriority.Lowest;
User.deadLooper.Start();
User.roomUser.walkLock = true;
}
}
}
}
else
{
if (User._roomID == _roomID && (roomUser.Y + 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X))
{
Room.sendShout(roomUser, "*Swings at " + args[1] + ", but misses*");
}
}
}
}
}
}
}
}
break;
}
#endregion
But it should make the user a ghost, and send them to the GraveYard.
this is also a updated kill command that will make them a ghost and send them to the grave yard.PHP Code:#region :kill <user>
case "kill":
{
if (_Rank > 6)
{
virtualUser User = userManager.getUser(args[1]);
Room.sendSaying(roomUser, "*summons a bolt of lightning instantly killing " + args[1] + "*");
User.sendData("D^" + "H" + Encoding.encodeVL64(168));
User.sendData("BK" + "An almighty admin has killed you." + Convert.ToChar(2));
User.Handler.ProcessPacket("Eu" + Encoding.encodeVL64(13));
User.Handler.ProcessPacket("Et" + Encoding.encodeVL64(13));
ThreadStart koStarter = new ThreadStart(User.knockOut);
User.deadLooper = new Thread(koStarter);
User.deadLooper.Priority = ThreadPriority.Lowest;
User.deadLooper.Start();
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET dead = '1', time_dead = '7' WHERE name = '" + User._Username + "'");
}
}
break;
}
#endregion
VirtualUser.cs --> Packet Processing ---> Non-Logged
Replace the Dead Timer W/ This
And a Updated Use Car, I will later do purchase.PHP Code://sends user back to the hospital
sendData("D^" + "H" + Encoding.encodeVL64(168));
sendData("BK" + "You logged out while you were dead.\r\rTherefore you MUST reset your dead timer by using the folowing command:\r:deadtimer\r\rThis will restart your dead timer to where you left off last login." + Convert.ToChar(2));
_Mission = "Dead";
refreshAppearance(false, true, true);
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(13));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(13));
}
}
else
And a Rocket CommandPHP Code:#region :use
case "use"://
{
string use = args[1];
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
if (use == "skateboard")
{
Room.sendSaying(roomUser, "*pulls out their hoverboard*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(2));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(2));
}
if (use == "ufo")
{
Room.sendSaying(roomUser, "*pulls out their UFO*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(3));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(3));
}
if (use == "car")
{
Room.sendSaying(roomUser, "*pulls out their rebel car*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(21));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(21));
}
if (use == "firecar")
{
Room.sendSaying(roomUser, "*pulls out their fire car*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(22));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(22));
}
}
}
break;
}
#endregion
If i may have missed something or didnt code it right please tell me x]PHP Code:#region :Rocket
case "rocket": // Rocket Command
{
Room.sendSaying(roomUser, "*pulls out their rocket*");
Handler.ProcessPacket("Eu" + Encoding.encodeVL64(6));
Handler.ProcessPacket("Et" + Encoding.encodeVL64(6));
}
break;
#endregion
Thanks!