[Release] AstroRP2 Superhire Commands

Lollipop

Member
Apr 27, 2013
42
2
#region :superhire x <jobid> <rankid>
case "superhire":
if (Session.GetHabbo().Rank > 3)
{
using (IQueryAdapter MySqlClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
if (Params.Length < 4)
{
Session.SendWhisper("Invalid syntax - :superhire <username> <jobid> <rankid>");
return true;
}
if (Session.GetHabbo().Rank < 3)
{
Session.SendWhisper("You Can't Use This Commands");
return true;
}
string Username = Params[1].ToLower();
string JobID = Params[2].ToLower();
string RankID = Params[3].ToLower();
Room room = Session.GetHabbo().CurrentRoom;
if (room == null)
{
return true;
}
RoomUser roomuser = room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (roomuser == null)
{
return true;
}
System.Data.DataRow Row1 = null;
System.Data.DataRow Row4 = null;
List<RoomUser> users = room.GetRoomUserManager().GetRoomUsers();
foreach (RoomUser user in users)
{
Username = user.GetClient().GetHabbo().Username;
MySqlClient.setQuery("SELECT * FROM groups WHERE id = '" + JobID + "'");
Row1 = MySqlClient.getRow();
MySqlClient.setQuery("SELECT * FROM groups_ranks WHERE jobid = '" + JobID + "' AND rankid = '" + RankID + "'");
Row4 = MySqlClient.getRow();
string jobname = (string)Row1["name"] + " " + (string)Row4["name"];
MySqlClient.addParameter("userid", user.GetClient().GetHabbo().Id);
MySqlClient.addParameter("rankid", RankID);
MySqlClient.addParameter("groupid", JobID);
MySqlClient.runFastQuery("INSERT INTO group_memberships (group_id, user_id, rank, jobrank) VALUES (" + JobID + ", " + user.GetClient().GetHabbo().Id + ", 1," + RankID + ")");
user.GetClient().GetHabbo().CorpID = Session.GetHabbo().CorpID;
Session.SendMessage(new Plus.Communication.Packets.Outgoing.Rooms.Chat.ShoutComposer(roomuser.VirtualId, "*Hires " + Username + " as " + jobname + "*", 0, 1));
user.GetClient().GetHabbo().Working = 0;
return true;
}
}
return true;
}
return true;
#endregion


Some ScreenShot

 

Jerry

not rly active lol
Jul 8, 2013
1,956
522
Dude, we aren't noobs, unless for some who is starting their own rp on Reality/AstroRP2.
 

Users who are viewing this thread

Top