Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Jul 22, 2010 22:16:13 GMT -6
$limit = "2";
function vehicle::onadd(%vehicleId) { %count = getWeaponCount(%vehicleId); %i = 0; %limitWeapons = 0; while(%i < %count) { %id = getWeaponId(%vehicleId,%i); if(((%id>=124)&&(%id<=136))||(%id==147)) { %limitWeapons++; } %i++; } if(%limitWeapons > $limit) { %player = playerManager::vehicleIdToPlayerNum(%vehicleId); healObject(%vehicleId,-50000); messageBox(%player, "You have more than the allotted amount of missles or mines on your vehicle.\nThe limit is: " @ $limit); } }
|
|
|
Post by eye on Jul 23, 2010 12:37:14 GMT -6
Ok Drake , I tried to place this and no work , where you add this at to make it work ?
I put up the Ctf server go in try to load a Herc with more then two racks, that`s the way I want TDM to work ..
Thankyou
eye
|
|
Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Jul 23, 2010 12:59:43 GMT -6
Ok here's a modification to it...that SHOULD work on all TDM maps.
$limit = "2";
function weaponCheck(%vehicleId) { %count = getWeaponCount(%vehicleId); %i = 0; %limitWeapons = 0; while(%i < %count) { %id = getWeaponId(%vehicleId,%i); if(((%id>=124)&&(%id<=136))||(%id==147)) { %limitWeapons++; } %i++; } if(%limitWeapons > $limit) { %player = playerManager::vehicleIdToPlayerNum(%vehicleId); healObject(%vehicleId,-50000); messageBox(%player, "You have more than the allotted amount of missles or mines on your vehicle.\nThe limit is: " @ $limit); } }
Open up DMstdlib.cs in the multiplayer folder and find:
function vehicle::onAdd(%this)
Add this at the very end of it:
weaponCheck(%this);
So it should look like this:
function vehicle::onAdd(%this) { if($server::TeamPlay != true) { // see if it is a player %player = playerManager::vehicleIdToPlayerNum(%this); if(%player == 0) // that's the server return; // so it's a player // shouldn't have to do this, but oh well setTeam(%this, *IDSTR_TEAM_RED); } weaponCheck(%this); }
|
|
|
Post by eye on Jul 23, 2010 13:57:40 GMT -6
//------------------------------------------------------------------------------
//
// DeathMatch standard library
//
//--------------------------------------
// Rules
// internal globals
// $killPoints: how many points scored for a kill
// $deathPoints: how many points LOST for dying
$killPoints = 3;
$deathPoints = 2;
$banJ = 0;
function setRules()
{ if($server::TeamPlay == true) { %rules = "<tIDMULT_TDM_GAMETYPE>" @ "<tIDMULT_TDM_MAPNAME>" @ $missionName @ "<tIDMULT_TDM_OBJECTIVES>" @ "<tIDMULT_TDM_SCORING_1>" @ "<tIDMULT_TDM_SCORING_2>" @ $killPoints @ "<tIDMULT_TDM_SCORING_3>" @ "<tIDMULT_TDM_SCORING_4>" @ $deathPoints @ "<tIDMULT_TDM_SCORING_5>" @ "<tIDMULT_TDM_SCORING_6>" @ "<tIDMULT_STD_ITEMS>" @ "<tIDMULT_STD_HEAL>" @ "<tIDMULT_STD_RELOAD_1>" @ $PadWaitTime @ "<tIDMULT_STD_RELOAD_2>" @ "<tIDMULT_STD_ZEN_1>" @ $ZenWaitTime @ "<tIDMULT_STD_ZEN_2>"; } else { %rules = "<tIDMULT_DM_GAMETYPE>" @ "<tIDMULT_DM_MAPNAME>" @ $missionName @ "<tIDMULT_DM_OBJECTIVES>" @ "<tIDMULT_DM_SCORING_1>" @ "<tIDMULT_DM_SCORING_2>" @ $killPoints @ "<tIDMULT_DM_SCORING_3>" @ "<tIDMULT_DM_SCORING_4>" @ $deathPoints @ "<tIDMULT_DM_SCORING_5>" @ "<tIDMULT_STD_ITEMS>" @ "<tIDMULT_STD_HEAL>" @ "<tIDMULT_STD_RELOAD_1>" @ $PadWaitTime @ "<tIDMULT_STD_RELOAD_2>" @ "<tIDMULT_STD_ZEN_1>" @ $ZenWaitTime @ "<tIDMULT_STD_ZEN_2>"; } setGameInfo(%rules);
}
// setup the rules
// this has to be called after the definition of setRules setRules();
function player::onAdd(%this)
{ player::onAddLog(%this); if($server::TeamPlay == true) {
say(%this,0, *IDMULT_TDM_WELCOME); } else { say(%this,0, *IDMULT_DM_WELCOME); }
}
function vehicle::onAdd(%this)
{
if($server::TeamPlay != true) { // see if it is a player %player = playerManager::vehicleIdToPlayerNum(%this); if(%player == 0) // that's the server return; // so it's a player // shouldn't have to do this, but oh well setTeam(%this, *IDSTR_TEAM_RED); }
}
{ if($server::TeamPlay != true) { // see if it is a player %player = playerManager::vehicleIdToPlayerNum(%this); if(%player == 0) // that's the server return;
// so it's a player
// shouldn't have to do this, but oh well setTeam(%this, *IDSTR_TEAM_RED); } weaponCheck(%this); }
//--------------------------------------
// Kick Team Attacker Jewelz
function vehicle::onAttacked(%this,%attacker)
{
if(getTeam(%this)==getTeam(%attacker)) { %player=playerManager::vehicleIdToPlayerNum(%attacker); if(strAlign(9,left,%player.IP)=="IP:71.229") {
if(%attacker!=%this) {
kick(%player,"Stop attacking your team or you will be banned till map cycles");$banJ++; } } } } function player::onAdd(%player)
{ %player.IP=getConnection(%player); if((strAlign(9,left,%player.IP)=="IP:71.229")&&$banJ>2) kick(%player, "Your done till the map cycles.");
}
//--------------------------------------
// Death Messages
function vehicle::onDestroyed(%destroyed, %destroyer)
{
// left over from missionStdLib.cs vehicle::onDestroyedLog(%destroyed, %destroyer); // this is weird but %destroyer isn't necessarily a vehicle %message = getFancyDeathMessage(getHUDName(%destroyed), getHUDName(%destroyer)); if(%message != "") {
say( 0, 0, %message); } // enforce the rules if($server::TeamPlay == true) {
if( (getTeam(%destroyed) == getTeam(%destroyer)) && (%destroyed != %destroyer) ) {
antiTeamKill(%destroyer); } }
}
//------------------------------------------------------------------------------
// scoreboard
function getPlayerScore(%a)
{ return((getKills(%a) * $killPoints) - (getDeaths(%a) * $deathPoints)); }
function getTeamScore(%a)
{
return((getTeamKills(%a) * $killPoints) - (getTeamDeaths(%a) * $deathPoints));
}
function initScoreBoard()
{
deleteVariables("$ScoreBoard::PlayerColumn*"); deleteVariables("$ScoreBoard::TeamColumn*");
if($server::TeamPlay == "True") { // Player ScoreBoard column headings $ScoreBoard::PlayerColumnHeader1 = *IDMULT_SCORE_TEAM; $ScoreBoard::PlayerColumnHeader2 = *IDMULT_SCORE_SQUAD; $ScoreBoard::PlayerColumnHeader3 = *IDMULT_SCORE_SCORE; $ScoreBoard::PlayerColumnHeader4 = *IDMULT_SCORE_KILLS; $ScoreBoard::PlayerColumnHeader5 = *IDMULT_SCORE_DEATHS;
// Player ScoreBoard column functions $ScoreBoard::PlayerColumnFunction1 = "getTeam"; $ScoreBoard::PlayerColumnFunction2 = "getSquad"; $ScoreBoard::PlayerColumnFunction3 = "getPlayerScore"; $ScoreBoard::PlayerColumnFunction4 = "getKills"; $ScoreBoard::PlayerColumnFunction5 = "getDeaths"; }
else { // Player ScoreBoard column headings $ScoreBoard::PlayerColumnHeader1 = *IDMULT_SCORE_SQUAD; $ScoreBoard::PlayerColumnHeader2 = *IDMULT_SCORE_SCORE; $ScoreBoard::PlayerColumnHeader3 = *IDMULT_SCORE_KILLS; $ScoreBoard::PlayerColumnHeader4 = *IDMULT_SCORE_DEATHS;
// Player ScoreBoard column functions $ScoreBoard::PlayerColumnFunction1 = "getSquad"; $ScoreBoard::PlayerColumnFunction2 = "getPlayerScore"; $ScoreBoard::PlayerColumnFunction3 = "getKills"; $ScoreBoard::PlayerColumnFunction4 = "getDeaths"; }
// Team ScoreBoard column headings $ScoreBoard::TeamColumnHeader1 = *IDMULT_SCORE_SCORE; $ScoreBoard::TeamColumnHeader2 = *IDMULT_SCORE_PLAYERS; $ScoreBoard::TeamColumnHeader3 = *IDMULT_SCORE_KILLS; $ScoreBoard::TeamColumnHeader4 = *IDMULT_SCORE_DEATHS;
// Team ScoreBoard column functions $ScoreBoard::TeamColumnFunction1 = "getTeamScore"; $ScoreBoard::TeamColumnFunction2 = "getNumberOfPlayersOnTeam"; $ScoreBoard::TeamColumnFunction3 = "getTeamKills"; $ScoreBoard::TeamColumnFunction4 = "getTeamDeaths";
// tell server to process all the scoreboard definitions defined above serverInitScoreBoard();
}
|
|
Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Jul 23, 2010 14:03:39 GMT -6
//------------------------------------------------------------------------------ // // DeathMatch standard library // //--------------------------------------
// Rules // internal globals //
$killPoints = 3;
$deathPoints = 2;
$banJ = 0;
$limit = 2;
function setRules()
{
if($server::TeamPlay == true)
{
%rules = "<tIDMULT_TDM_GAMETYPE>" @
"<tIDMULT_TDM_MAPNAME>" @
$missionName @
"<tIDMULT_TDM_OBJECTIVES>" @
"<tIDMULT_TDM_SCORING_1>" @
"<tIDMULT_TDM_SCORING_2>" @
$killPoints @
"<tIDMULT_TDM_SCORING_3>" @
"<tIDMULT_TDM_SCORING_4>" @
$deathPoints @
"<tIDMULT_TDM_SCORING_5>" @
"<tIDMULT_TDM_SCORING_6>" @
"<tIDMULT_STD_ITEMS>" @
"<tIDMULT_STD_HEAL>" @
"<tIDMULT_STD_RELOAD_1>" @
$PadWaitTime @
"<tIDMULT_STD_RELOAD_2>" @
"<tIDMULT_STD_ZEN_1>" @
$ZenWaitTime @
"<tIDMULT_STD_ZEN_2>";
}
else
{
%rules = "<tIDMULT_DM_GAMETYPE>" @
"<tIDMULT_DM_MAPNAME>" @
$missionName @
"<tIDMULT_DM_OBJECTIVES>" @
"<tIDMULT_DM_SCORING_1>" @
"<tIDMULT_DM_SCORING_2>" @
$killPoints @
"<tIDMULT_DM_SCORING_3>" @
"<tIDMULT_DM_SCORING_4>" @
$deathPoints @
"<tIDMULT_DM_SCORING_5>" @
"<tIDMULT_STD_ITEMS>" @
"<tIDMULT_STD_HEAL>" @
"<tIDMULT_STD_RELOAD_1>" @
$PadWaitTime @
"<tIDMULT_STD_RELOAD_2>" @
"<tIDMULT_STD_ZEN_1>" @
$ZenWaitTime @
"<tIDMULT_STD_ZEN_2>";
}
setGameInfo(%rules);
}
// setup the rules
// this has to be called after the definition of setRules setRules();
function player::onAdd(%this)
{
player::onAddLog(%this);
if($server::TeamPlay == true)
{
say(%this,0, *IDMULT_TDM_WELCOME);
}
else
{ say(%this,0, *IDMULT_DM_WELCOME);
}
}
function weaponCheck(%vehicleId) { %count = getWeaponCount(%vehicleId); %i = 0; %limitWeapons = 0; while(%i < %count) { %id = getWeaponId(%vehicleId,%i); if(((%id>=124)&&(%id<=136))||(%id==147)) { %limitWeapons++; } %i++; } if(%limitWeapons > $limit) { %player = playerManager::vehicleIdToPlayerNum(%vehicleId); healObject(%vehicleId,-50000); messageBox(%player, "You have more than the allotted amount of missles or mines on your vehicle.\nThe limit is: " @ $limit); } }
function vehicle::onAdd(%this) { if($server::TeamPlay != true) { // see if it is a player %player = playerManager::vehicleIdToPlayerNum(%this); if(%player == 0) // that's the server return; // so it's a player
// shouldn't have to do this, but oh well setTeam(%this, *IDSTR_TEAM_RED); } weaponCheck(%this); }
//--------------------------------------
// Kick Team Attacker Jewelz
function vehicle::onAttacked(%this,%attacker)
{
if(getTeam(%this)==getTeam(%attacker))
{
%player=playerManager::vehicleIdToPlayerNum(%attacker);
if(strAlign(9,left,%player.IP)=="IP:71.229")
{
if(%attacker!=%this)
{
kick(%player,"Stop attacking your team or you will be banned till map cycles");$banJ++;
}
}
} } function player::onAdd(%player)
{
%player.IP=getConnection(%player);
if((strAlign(9,left,%player.IP)=="IP:71.229")&&$banJ>2) kick(%player, "Your done till the map cycles.");
}
//--------------------------------------
// Death Messages
function vehicle::onDestroyed(%destroyed, %destroyer)
{
// left over from missionStdLib.cs vehicle::onDestroyedLog(%destroyed, %destroyer);
// this is weird but %destroyer isn't necessarily a vehicle
%message = getFancyDeathMessage(getHUDName(%destroyed), getHUDName(%destroyer)); if(%message != "")
{
say( 0, 0, %message);
}
// enforce the rules if($server::TeamPlay == true)
{
if( (getTeam(%destroyed) == getTeam(%destroyer)) && (%destroyed != %destroyer) )
{
antiTeamKill(%destroyer);
}
}
}
//------------------------------------------------------------------------------
// scoreboard
function getPlayerScore(%a)
{ return((getKills(%a) * $killPoints) - (getDeaths(%a) * $deathPoints)); }
function getTeamScore(%a)
{
return((getTeamKills(%a) * $killPoints) - (getTeamDeaths(%a) * $deathPoints));
}
function initScoreBoard()
{
deleteVariables("$ScoreBoard::PlayerColumn*");
deleteVariables("$ScoreBoard::TeamColumn*");
if($server::TeamPlay == "True")
{
// Player ScoreBoard column headings
$ScoreBoard::PlayerColumnHeader1 = *IDMULT_SCORE_TEAM;
$ScoreBoard::PlayerColumnHeader2 = *IDMULT_SCORE_SQUAD;
$ScoreBoard::PlayerColumnHeader3 = *IDMULT_SCORE_SCORE;
$ScoreBoard::PlayerColumnHeader4 = *IDMULT_SCORE_KILLS;
$ScoreBoard::PlayerColumnHeader5 = *IDMULT_SCORE_DEATHS;
// Player ScoreBoard column functions
$ScoreBoard::PlayerColumnFunction1 = "getTeam";
$ScoreBoard::PlayerColumnFunction2 = "getSquad";
$ScoreBoard::PlayerColumnFunction3 = "getPlayerScore";
$ScoreBoard::PlayerColumnFunction4 = "getKills";
$ScoreBoard::PlayerColumnFunction5 = "getDeaths";
}
else
{
// Player ScoreBoard column headings
$ScoreBoard::PlayerColumnHeader1 = *IDMULT_SCORE_SQUAD;
$ScoreBoard::PlayerColumnHeader2 = *IDMULT_SCORE_SCORE;
$ScoreBoard::PlayerColumnHeader3 = *IDMULT_SCORE_KILLS;
$ScoreBoard::PlayerColumnHeader4 = *IDMULT_SCORE_DEATHS;
// Player ScoreBoard column functions
$ScoreBoard::PlayerColumnFunction1 = "getSquad";
$ScoreBoard::PlayerColumnFunction2 = "getPlayerScore";
$ScoreBoard::PlayerColumnFunction3 = "getKills";
$ScoreBoard::PlayerColumnFunction4 = "getDeaths";
}
// Team ScoreBoard column headings
$ScoreBoard::TeamColumnHeader1 = *IDMULT_SCORE_SCORE;
$ScoreBoard::TeamColumnHeader2 = *IDMULT_SCORE_PLAYERS;
$ScoreBoard::TeamColumnHeader3 = *IDMULT_SCORE_KILLS;
$ScoreBoard::TeamColumnHeader4 = *IDMULT_SCORE_DEATHS;
// Team ScoreBoard column functions
$ScoreBoard::TeamColumnFunction1 = "getTeamScore";
$ScoreBoard::TeamColumnFunction2 = "getNumberOfPlayersOnTeam";
$ScoreBoard::TeamColumnFunction3 = "getTeamKills";
$ScoreBoard::TeamColumnFunction4 = "getTeamDeaths";
// tell server to process all the scoreboard definitions defined above serverInitScoreBoard();
}
|
|
|
Post by eye on Jul 23, 2010 15:52:14 GMT -6
CREATING DUST MANAGER Executing master.cs. messageCanvasDevice: simCanvasName string Executing datLoad.cs. Executing datProjectile.cs. Executing datWeapon.cs. Executing datTurret.cs. Executing datSensor.cs. Executing datReactor.cs. Executing datShield.cs. Executing datEngine.cs. Executing datIntMounts.cs. Executing datArmor.cs. Executing datVehicle.cs. Executing datHerc_tr_apoc.cs. Executing datHerc_tr_mino.cs. Executing datHerc_tr_gorg.cs. Executing datHerc_tr_talo.cs. Executing datHerc_tr_basl.cs. Executing datTank_tr_pala.cs. Executing datTank_tr_myrm.cs. Executing datTank_tr_disr.cs. Executing datFlyer_tr_bans.cs. ****************************************************************** datFlyer_tr_b ans.cs Line: 91 - SYNTAX ERROR. Executing datHerc_kn_apoc.cs. Executing datHerc_kn_mino.cs. Executing datHerc_kn_gorg.cs. Executing datHerc_kn_talo.cs. Executing datHerc_kn_basl.cs. Executing datTank_kn_pala.cs. Executing datTank_kn_myrm.cs. Executing datTank_kn_disr.cs. Executing datFlyer_tr_carg.cs. Executing datFlyer_tr_escape.cs. Executing datHerc_cy_seek.cs. Executing datHerc_cy_goad.cs. Executing datHerc_cy_shep.cs. Executing datHerc_cy_adju.cs. Executing datHerc_cy_exec.cs. Executing datTank_cy_bolo.cs. Executing datHerc_pl_adju.cs. Executing datHerc_pl_exec.cs. Executing datTank_cy_recl.cs. Executing datHerc_cy_prom.cs. ****************************************************************** datHerc_cy_pr om.cs Line: 106 - SYNTAX ERROR. Executing datHerc_rb_eman.cs. Executing datTank_rb_aven.cs. Executing datTank_rb_drea.cs. Executing datHerc_rb_oly.cs. Executing datHerc_mg_seek.cs. Executing datHerc_mg_goad.cs. Executing datHerc_mg_shep.cs. Executing datHerc_mg_adju.cs. Executing datHerc_mg_exec.cs. Executing datHerc_ha_apoc.cs. Executing datTank_ha_pred.cs. Executing datHerc_ca_basl.cs. ****************************************************************** datHerc_ca_ba sl.cs Line: 97 - SYNTAX ERROR. Executing datHerc_cin_apoc.cs. ****************************************************************** datHerc_cin_a poc.cs Line: 103 - SYNTAX ERROR. Executing datHerc_cin_basl.cs. ****************************************************************** datHerc_cin_b asl.cs Line: 100 - SYNTAX ERROR. Executing datTank_SuperPred.cs. Executing datHerc_pi_apoc.cs. ****************************************************************** datHerc_pi_ap oc.cs Line: 100 - SYNTAX ERROR. Executing datTank_pi_drea.cs. ****************************************************************** datTank_pi_dr ea.cs Line: 87 - SYNTAX ERROR. Executing datHerc_pi_eman.cs. Executing datHerc_pl_adju2.cs. Executing datHerc_pl_exec2.cs. Executing datDroneGeneric.cs. Executing datDrone_tr_fltb.cs. Executing datDrone_tr_ammo.cs. Executing datDrone_tr_big_ammo.cs. Executing datDrone_tr_big_personnel.cs. Executing datDrone_tr_fuel.cs. Executing datDrone_tr_mino.cs. Executing datDrone_rb_fltb.cs. Executing datDrone_rb_ammo.cs. Executing datDrone_rb_big.cs. Executing datDrone_rb_big_box.cs. Executing datDrone_rb_box.cs. Executing datDrone_tr_util.cs. Executing datDrone_rb_thum.cs. Executing datDrone_tr_star.cs. Executing datDrone_tr_sove.cs. Executing datDrone_tr_surv.cs. Executing datTank_cy_artl.cs. Executing datFlyer_cy_advo.cs. Executing datFlyer_cy_drop.cs. Executing datFlyer_cy_cons.cs. Executing datDrone_cy_omni.cs. Executing datDrone_cy_prot.cs. Executing datDrone_cy_jamm.cs. Executing datFlyer_kn_bans.cs. Executing datFlyer_kn_drop.cs. Executing datFlyer_tr_drop.cs. Executing datFlyer_tr_drac.cs. Executing datFlyer_tr_conv.cs. Executing datTank_tr_nike.cs. ****************************************************************** datTank_tr_ni ke.cs Line: 87 - SYNTAX ERROR. Executing datTank_tr_supr.cs. ****************************************************************** datTank_tr_su pr.cs Line: 79 - SYNTAX ERROR. Executing datTank_rb_artl.cs. Executing datTank_rb_bike.cs. ****************************************************************** datTank_rb_bi ke.cs Line: 84 - SYNTAX ERROR. Executing datTank_ss_bus.cs. ****************************************************************** datTank_ss_bu s.cs Line: 81 - SYNTAX ERROR. Executing autoexec.cs. Executing defaultPrefs.cs. Executing datFormation.cs. Executing datIRC.cs. COMMAND LINE SERVER server_TDM_ALL.cs Executing server_TDM_ALL.cs. Executing serverLocation.cs. Executing server.cs. SUCCESS on PORT 29001 deleteObject: Object "MissionGroup" doesn't exist deleteObject: Object "MissionCleanup" doesn't exist Executing missionStdLib.cs. Executing squadActions.cs. Executing TDM_Subsist.cs. Executing multiplayerStdLib.cs. Executing DMstdLib.cs. exec: invalid script file iai\iai.cs. Version V 001.004r Sending 0 players Sending 0 players %
|
|
Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Jul 23, 2010 15:57:34 GMT -6
Ok the line I was looking for was:
Executing DMstdLib.cs
If that caused an error. The only errors you have are in dat files that could be easily fixed but they cause no issues.
|
|
|
Post by eye on Jul 23, 2010 15:59:27 GMT -6
and it does not work yet on server
|
|
|
Post by eye on Jul 23, 2010 16:02:49 GMT -6
i wonder if i reboot but that isnt it , i dont think
|
|
Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Jul 23, 2010 16:16:39 GMT -6
E-mail me the exact file: deathdrake_1@yahoo.com - proboards is screwing it up somehow. The back up file not the one you pasted.
|
|
rom
Site Member
Posts: 76
|
Post by rom on Aug 21, 2010 12:17:48 GMT -6
I like the limits on number of missiles, but why do you need to limit the number of mines?
|
|
Drake™
Site Member
???
Posts: 175
|
Post by Drake™ on Aug 21, 2010 17:50:58 GMT -6
Limiting ANYTHING in SS sucks. To allow a weapon and then limit it's rounds or number of mounts is criminal. I'm sick and tired of you TDM players whineing about what weapons ppl use and how they use them. If you had your way, all we would have is emps and pbw's to use. This is NOT the way the game was meant to be played. How about just changing your precious fig to counter a threat instead of whineing untill the weapon is banned or restricted? Using appropiate countermeasures is the way this game was intended to be played. We already have one TDM server that is heavily limited, we certainly dont need anymore! I apologize for the way you feel Duster - however this post is ancient and was requested by Eye. Take it up with him - however I don't really have the time to play anymore so I do not know how things are done now.
|
|