Here, let me give you some sample coding on how to make an add - on:
egisterGameMode("Deathmatch","DM",0,0,0);
setGameModeHelp("Deathmatch","Add-Ons/Gamemode_TeamDeathmatch/rules_dm.txt");
addGameModeRule("Deathmatch","Time","int 0 30",0);
addGameModeRule("Deathmatch","Lives","int 0 10",0);
addGameModeRule("Deathmatch","Points","int 0 10000",0);
//For an explanation of when these functions are used, see Gamemode_EXAMPLE.cs
function GameMode_DM_onModeUpdateRule0(%mini,%rulevalue,%oldvalue,%modestart)
{
//Don't reset the minigame if it's the mode start and the setting is off, as a normal deathmatch shouldn't reset the minigame
return !(%modestart && %rulevalue == 0);
}
function GameMode_DM_onModeUpdateRule1(%mini,%rulevalue,%oldvalue,%modestart)
{
//Don't reset the minigame if it's the mode start and the setting is off, as a normal deathmatch shouldn't reset the minigame
return !(%modestart && %rulevalue == 0);
}
function GameMode_DM_onModeUpdateRule2(%mini,%rulevalue,%oldvalue,%modestart)
{
//Don't reset the minigame if it's the mode start and the setting is off, as a normal deathmatch shouldn't reset the minigame
return !(%modestart && %rulevalue == 0);
}
function GameMode_DM_onMiniReset(%mini,%client)
{
if(%mini.tdmModeRule[0] != 0)
%mini.messageAll('',"\c5This round lasts \c3" @ %mini.tdmModeRule[0] @ "\c5 minute" @ (%mini.tdmModeRule[0] == 1 ? "" : "s") @ ".");
if(%mini.tdmModeRule[1] != 0)
%mini.messageAll('',"\c5You have \c3" @ %mini.tdmModeRule[1] @ "\c5 " @ (%mini.tdmModeRule[1] == 1 ? "life" : "lives") @ " remaining.");
if(%mini.tdmModeRule[2] != 0)
%mini.messageAll('',"\c5The first player to reach \c3" @ %mini.tdmModeRule[2] @ "\c5 point" @ (%mini.tdmModeRule[2] == 1 ? "" : "s") @ " wins.");
%mini.setTimeLimit(%mini.tdmModeRule[0]);
%mini.setLivesLimit(%mini.tdmModeRule[1]);
%mini.setPointsLimit(%mini.tdmModeRule[2]);
}
function GameMode_DM_onTimeLimit(%mini)
{
//Edited version of Minigame::roundEnd to find the highest scores and make those people win
//Removed the team checks as they're unnecessary, see Gamemode_Team Deathmatch.cs for that
//Multiple players can win the round at once
if(%mini.roundWon)
return;
That's from Space Guy's TDM thing.