[RP] Team Deathmatch [Sledmore]
Hey guys,
Well this isn't a really good release, But still, It's a simple event game for RP servers.
Right, I'm going to release different parts of it. The game is 'Team Deathmatch' :).
Right, firstly, search for this;
Code:
//gets information from the database
under it add this;
Code:
int blacktdm = dbClient.getInt("SELECT yellow_team FROM users WHERE name = '" + _Username + "'");
int yellowtdm = dbClient.getInt("SELECT black_team FROM users WHERE name = '" + _Username + "'");
Right, Search for this;
Code:
if (dead == 1)
{
//sends user back to the hospital
sendData("D^" + "H" + Encoding.encodeVL64(2));
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.");
_Mission = "Dead";
refreshAppearance(false, true, true);
}
}
}
And under it add this;
Code:
else
{
if (blacktdm == 1)
{
_Mission = "Black Team - Team Death Match!";
_Figure = _Uni + "ch-210-110.lg-281-110.sh-290-110";
refreshAppearance(false, true, true);
sendData("D^" + "H" + Encoding.encodeVL64(onloadroom));
dbClient.runQuery("UPDATE users SET black_team = '1' WHERE name = '" + _Username + "'");
}
else if (yellowtdm == 1)
{
_Mission = "Yellow Team - Team Death Match!";
_Figure = _Uni + "ch-210-93.lg-281-93.sh-290-93";
refreshAppearance(false, true, true);
sendData("D^" + "H" + Encoding.encodeVL64(onloadroom));
dbClient.runQuery("UPDATE users SET yellow_team = '1' WHERE name = '" + _Username + "'");
}
else if (yellowtdm == 0 || blacktdm == 0)
{
sendData("D^" + "H" + Encoding.encodeVL64(onloadroom));
}
}
}
break;
}
Then, on punch, on the default events, add this;
Code:
if (User._Mission == "Yellow Team - Team Death Match!")
{
if (_Mission == "Black Team - Team Death Match!" || User._Mission == "Yellow Team - Team Death Match!")
{
dbClient.runQuery("UPDATE users SET game_dm = game_dm + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(21));
User.sendData("BK" + "Thank you for playing team deathmatch.");
dbClient.runQuery("UPDATE users SET yellow_team = '0' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET black_team = '0' WHERE name = '" + User._Username + "'");
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the lobby*");
}
if (User._Mission == "Black Team - Team Death Match!")
{
if (_Mission == "Yellow Team - Team Death Match!" || User._Mission == "Black Team - Team Death Match!")
{
dbClient.runQuery("UPDATE users SET game_dm = game_dm + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(21));
User.sendData("BK" + "Thank you for playing team deathmatch.");
dbClient.runQuery("UPDATE users SET yellow_team = '0' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET black_team = '0' WHERE name = '" + User._Username + "'");
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the lobby*");
}
Here are some one way gates (;
Note: You'll have to add a figure in here, as mine was all splits.
Code:
if (Item.Sprite == "one_way_door*8")
{
int isWorking;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
}
if (isWorking == 1)
{
workLooper.Abort();
workLooper = null;
}
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
_Mission = "Black Team - Team Death Match!";
refreshAppearance(false, true, true);
dbClient.runQuery("UPDATE users SET black_team = '1' WHERE name = '" + _Username + "'");
}
}
if (Item.Sprite == "one_way_door*9")
{
int isWorking;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
}
if (isWorking == 1)
{
workLooper.Abort();
workLooper = null;
}
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
_Mission = "Yellow Team - Team Death Match!";
refreshAppearance(false, true, true);
dbClient.runQuery("UPDATE users SET yellow_team = '1' WHERE name = '" + _Username + "'");
}
}
Right, here is the kickfromgame for staff above the rank 4.
Code:
#region :kickfromgame (events)
case "kickfromgame":
{
if (_Rank > 4)
{
virtualUser User = userManager.getUser(args[1]);
{
if (User._Mission == "[Game] Deathmatch" || User._Mission == "[Game] Brawl" || User._Mission == "Yellow Team - Team Death Match!" || User._Mission == "Black Team - Team Death Match!" || User._Mission == "Red Fighter - Arena Fight!" || User._Mission == "Blue Fighter - Arena Fight!")
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
User.sendData("BK" + "Thank you for playing, You have been kicked from the game, By an administrator!");
dbClient.runQuery("UPDATE users SET yellow_team = '0' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET black_team = '0' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + _Username + "'");
User.sendData("D^" + "H" + Encoding.encodeVL64(21));
User.refreshAppearance(true, true, true);
}
}
else
{
sendData("BK" + "This user is not in a game!");
}
}
}
break;
}
#endregion
And also, here is the :leavegame command!
Code:
#region :leavegame (events)
case "leavegame":
{
if (this._Mission == "[Game] Deathmatch" || this._Mission == "[Game] Brawl" || this._Mission == "Yellow Team - Team Death Match!" || this._Mission == "Black Team - Team Death Match!" || this._Mission == "Red Fighter - Arena Fight!" || this._Mission == "Blue Fighter - Arena Fight!")
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
sendData("BK" + "Thank you for playing, You have been sent to the events lobby!");
dbClient.runQuery("UPDATE users SET yellow_team = '0' WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET black_team = '0' WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + _Username + "'");
this.sendData("D^" + "H" + Encoding.encodeVL64(21));
this.refreshAppearance(true, true, true);
}
}
else
{
sendData("BK" + "You are not in a game!");
}
break;
}
#endregion
Right, You need to add in some collums in the user table, the two;
yellow_team
black_team
both int 1, as defined = 0 (;
I know this looks messy, But i never thought about releasing this, or improving.. If you would like to go do it!
Thanks, Also, remember to click thanks if you like it. (;
I'm sorry this isnt a really good tutorial to setting it up, but it's easy ;).
Oh, one last thing, You'll need to do an SQL, for the gates :P.
[EDIT]
added SQL;
Code:
INSERT INTO `catalogue_items` (`tid`, `catalogue_name`, `catalogue_description`, `catalogue_cost`, `typeid`, `length`, `width`, `top`, `name_cct`, `colour`, `catalogue_id_page`, `door`, `tradeable`, `recycleable`, `catalogue_id_index`, `cip`, `cid`) VALUES
(342543, 'Black teamdeath match gate', 'this one is used for team deathmatch!!', 5, 1, 1, 1, 0.00, 'one_way_door*8', '#525252,#ffffff,#525252', 100, '0', '1', '1', 20, 0, 0),
(342544, 'Yellow teamdeath match gate', 'this one is used for team deathmatch!!', 5, 1, 1, 1, 0.00, 'one_way_door*9', '#FFD837,#ffffff,#FFD837', 100, '0', '1', '1', 20, 0, 0);
Re: [RP] Team Deathmatch [Sledmore]
Re: [RP] Team Deathmatch [Sledmore]
Soon as i seen the name Sledmore i knew this would be good nice one sledy *Clicks the thanks button*
Re: [RP] Team Deathmatch [Sledmore]
Re: [RP] Team Deathmatch [Sledmore]
Everyone like forgot about the RPs?
They backsided it, but its good to see that you still have time to do some roleplay releases.
Re: [RP] Team Deathmatch [Sledmore]
Thank you guys, I'l most likely release other things, I have ;).
Quote:
Originally Posted by
vLife
Everyone like forgot about the RPs?
They backsided it, but its good to see that you still have time to do some roleplay releases.
Ya ikr, and Thanks :P.
Re: [RP] Team Deathmatch [Sledmore]
Why don't you just do tinyint instead of int? then on C# do the int equivalent (in16 ? idfk)
Re: [RP] Team Deathmatch [Sledmore]
Re: [RP] Team Deathmatch [Sledmore]
Quote:
Originally Posted by
Moogly
Why don't you just do tinyint instead of int? then on C# do the int equivalent (in16 ? idfk)
Er, What's TinyInt? Thanks though, I'l try and figure what it is, and use it in the future ;).
Quote:
Originally Posted by
FreshKickzCobe
df is a TinyInt?
I know right, I'm baffled too lol.
Re: [RP] Team Deathmatch [Sledmore]
is this Holograph or Uber ??
Re: [RP] Team Deathmatch [Sledmore]
Quote:
Originally Posted by
Beny.
is this Holograph or Uber ??
Holograph obviously, when in the Development section was there an ever UberRP?
-|ivar
Re: [RP] Team Deathmatch [Sledmore]
Now, I have made an UberRP ...
Re: [RP] Team Deathmatch [Sledmore]
Quote:
Originally Posted by
Beny.
is this Holograph or Uber ??
Holograph.
Quote:
Originally Posted by
Beny.
Now, I have made an UberRP ...
Cool, Can I see it (;?
Re: [RP] Team Deathmatch [Sledmore]
Re: [RP] Team Deathmatch [Sledmore]
Sledmore, Its mine and PEjump2's :P
Im making a thread now ...