Forums Index >> Modding >> CODES/ADMIN Version 0.02



Page : <1> :


VERSION 0.02 IS OBSOLETE GET VERSION 0.03

Hi all,
I have made updates to my codes script.
Go here to get it
I am about done with the codes I am interested in. Please let me know
if you have any requests for new codes, or add your own, I have provided
the full source code for those who know what to do with it.

 

CREDITS
--------------------------------------------------------------
People who helped me with this, in no particular order
(da)Entropy,Trivox, Stan, Rogue, NUTS, 56K Lagman, Supra,
Rooster. There are more but I can't remember them all.
If you think your name belongs here please let me know.

FEATURES
---------------------------------------------------------------
Added function matchClientName which was graciously provided
by 56K Lagman and assures mac compatibility.

Changed the internals/code, mostly tidying up.

Removed the ability to type "adm password" and expose your admin
password when you really meant "/adm password"

Added the ability to kill individual players.
Added the ability to rename players

CODES FOR PLAYERS
// name : private chat
/ message : team chat
/ping name : check a players ping
/codes : list available code

CODES FOR ADMINS
/adm password : login as admin so you can access admin codes
/nuke : kill all players, good for reset/game start
/k name : kick a player by name, name fragments work
/nk CADD : kick a player by CADD
/s name : silence a player by name
/ns CADD : silence a player by CADD
/stat name : list a players stats by name (NAME,CADD,PING,IP)
/stats : list all players stats by name (NAME,CADD,PING,IP)
/r name new_name : rename a player, good for those inappropriate ones
/nr CADD new_name: rename a player using CADD, good for those
inappropriate and illegible ones
/ki : kill an individual player

 

Last edited: Sunday, August 08, 2004 at 3:32:15 PM

Saturday, July 31, 2004 at 6:50:23 PM

Hmmm..!! I don´t know anything about source coding, but mabe I can help out with code ideas!

1) what about being able to shange u´r tank (or and individual´s tank) into any tank, even a big ufo!! That´d be tight!! (ot into a shape)

2) shut doun a player´s ability 2 shoot!

3) ability to change u´r (or an individual´s )stats while in game play! (if the admin wants 2 ina mod or something), or punish ill behaved players by making them unable 2 move :P , or make them go in endless circles by controlling their tank XD (I know, that last 1 might be 2 hard :P )

4) able 2 change teams withought having 2 leave the server (help the under dog team)

5) spawn mulitple items (like multiple flags, or add a few boostpads 2 change the course of a game (an optional I guess) :P

6) be able 2 add time to the remaing time in game (optional 2)

I´ll let u know if I think of any more ;)

Cadc (SA) (Leader)

 

**..::I am thoroughly... amused:::..**

Saturday, July 31, 2004 at 8:00:08 PM
-z-

Might I suggest using /tm and /pm for team message and private message instead of /name and /message (like has been used on PTT servers for almost a year and which are both far less tedious to type)

 

 

 

 

Saturday, July 31, 2004 at 8:00:12 PM

I agree with -z- ;)

Cadc (SA) (Leader)

**..::I am thoroughly... amused:::..**

Saturday, July 31, 2004 at 8:01:03 PM

Just to clarify for dash on the chat part of his script.
You don't need to type the following after the forward slash(es):
/ message
// name

All you need to type are the / and //.
For instance to talk with me privately type // ROGUE hi how are you
For team chat type / let's crush blue

Like a midget at a urinal, I was going to have to be on my toes.

Invite a retard to a picnic and you'd better expect to get drool in the potato salad.

Saturday, July 31, 2004 at 8:19:44 PM

Yea, we gathered already :)

Cadc (SA) (Leader)

**..::I am thoroughly... amused:::..**

Saturday, July 31, 2004 at 8:38:55 PM

I have someone to add to the credits, Ishbuu IBotI, the one you stole V1 from.

Saturday, July 31, 2004 at 9:04:15 PM

Nathan you really are a supreme schmuck.

Like a midget at a urinal, I was going to have to be on my toes.

Invite a retard to a picnic and you'd better expect to get drool in the potato salad.

Saturday, July 31, 2004 at 10:06:18 PM

@Nathan:
I wish you would talk to Ish and stop propagating that myth Nathan, it's quite rude.
Ish shared nothing, I gave him a function, as I said before.

@ -z- I will add /tm and /pm so they work in addition to / and // as compatibility is good and PTT set the precedent. But I think I didn't make clear what I meant. My codes are in fact shorter.
my team chat: / hi team
your team chat: /tm hi team

My private chat: // rogue hi
your private chat: /pm rogue hi

Because you already have to type a / to access any code this makes team chat the fastest code available.
and also speeds up private chat because you double tap a single character "/' instead of three distinct
characters "/pm".

Saturday, July 31, 2004 at 10:15:33 PM

Wow dash. Looks like a very nice set of tools! Thanks a lot! I'll give it a go. -Rx

 

 

-Rx

 

 

Sunday, August 01, 2004 at 4:15:51 PM

I have idea. Lets try this(somehow) :) :

/boss=bosstank
/ufo=babyboss
/light=lightank
/med=mediumtank
/heavy=heavytank
Plus a way 2 teleport. Try the codes first. ;)

Intruder

Last edited: Monday, August 02, 2004 at 10:27:58 AM

Monday, August 02, 2004 at 10:25:33 AM

Ok, hi peoples, do I have to do a special thing (script) in order to use this?? Whats a CADD?? But basically my main question is do I need a script to use theese?

TK62

Monday, August 02, 2004 at 2:16:44 PM

I need da admin to be da admin to use deez codes!!! Lol. :P NEED ADMIN CODE TO USE THEESE!!!!! IN OTHER WORDS, HOW DO I BECOME AN ADMIN!!!!

TK62_(NA) GRR.

Monday, August 02, 2004 at 2:44:40 PM

Ok, practically I got it, heres wat my files look like.

Prefs.cs:

$pref::Audio::drivers = "";

$pref::Audio::environmentEnabled = 0;

$pref::Audio::forceMaxDistanceUpdate = 0;

$pref::Audio::masterVolume = 0.8;
$pref::Server::AdminPassword=LPfan

$pref::CloudsOn = "1";

$pref::Decal::decalTimeout = "5000";

$pref::Decal::maxNumDecals = "256";

$pref::decalsOn = "1";

$pref::Editor::visibleDistance = "2100";

$pref::environmentMaps = "1";

$pref::Input::JoystickEnabled = "0";

$pref::Input::KeyboardEnabled = "1";

$pref::Input::KeyboardTurnSpeed = 0.1;

$pref::Input::LinkMouseSensitivity = 1;

$pref::Input::MouseEnabled = "0";

$pref::Interior::detailAdjust = "1";

$pref::Interior::DynamicLights = "1";

$pref::Interior::LightUpdatePeriod = "66";

$pref::Interior::lockArrays = "1";

$pref::Interior::ShowEnvironmentMaps = "1";

$pref::Interior::TexturedFog = "0";

$pref::Interior::VertexLighting = "0";

$Pref::Net::LagThreshold = "0";

$pref::Net::PacketRateToClient = "10";

$pref::Net::PacketRateToServer = "32";

$pref::Net::PacketSize = "200";

$pref::NumCloudLayers = "3";

$pref::OpenGL::allowCompression = "0";

$pref::OpenGL::allowTexGen = "1";

$pref::OpenGL::disableARBMultitexture = "0";

$pref::OpenGL::disableARBTextureCompression = "0";

$pref::OpenGL::disableEXTCompiledVertexArray = "0";

$pref::OpenGL::disableEXTFogCoord = "0";

$pref::OpenGL::disableEXTPalettedTexture = "0";

$pref::OpenGL::disableEXTTexEnvCombine = "0";

$pref::OpenGL::disableSubImage = "0";

$pref::OpenGL::force16BitTexture = "0";

$pref::OpenGL::forcePalettedTexture = "0";

$pref::OpenGL::gammaCorrection = "0.5";

$pref::OpenGL::maxHardwareLights = "3";

$pref::OpenGL::noDrawArraysAlpha = "0";

$pref::OpenGL::noEnvColor = "0";

$pref::OpenGL::textureAnisotropy = "0";

$pref::OpenGL::textureTrilinear = "0";

$pref::Player::renderMyItems = "1";

$pref::Player::renderMyPlayer = "1";

$pref::precipitationOn = "1";

$pref::prePause = "0";

$pref::sceneLighting::cacheLighting = 1;

$pref::sceneLighting::cacheSize = 20000;

$pref::sceneLighting::purgeMethod = "lastCreated";

$pref::sceneLighting::terrainGenerateLevel = 1;

$pref::shadows = "2";

$pref::SkyOn = "1";

$pref::Terrain::dynamicLights = "1";

$pref::Terrain::enableDetails = "1";

$pref::Terrain::enableEmbossBumps = "1";

$pref::Terrain::screenError = "4";

$pref::Terrain::texDetail = "0";

$pref::Terrain::textureCacheSize = "220";

$pref::TS::autoDetail = "1";

$pref::TS::detailAdjust = "1";

$pref::TS::fogTexture = "0";

$pref::TS::screenError = "5";

$pref::TS::skipFirstFog = "0";

$pref::TS::skipLoadDLs = "0";

$pref::TS::skipRenderDLs = "0";

$pref::Video::allowD3D = "1";

$pref::Video::allowOpenGL = "1";

$pref::Video::appliedPref = "1";

$pref::Video::clipHigh = "0";

$pref::Video::defaultsRenderer = "GeForce FX 5200/AGP/SSE2";

$pref::Video::defaultsVendor = "NVIDIA Corporation";

$pref::Video::deleteContext = "1";

$pref::Video::disableVerticalSync = 1;

$pref::Video::displayDevice = "OpenGL";

$pref::Video::fullScreen = "0";

$pref::Video::only16 = "0";

$pref::Video::preferOpenGL = "1";

$pref::Video::profiledRenderer = "GeForce FX 5200/AGP/SSE2";

$pref::Video::profiledVendor = "NVIDIA Corporation";

$pref::Video::resolution = "800 600 32";

$pref::Video::safeModeOn = "1";

$pref::visibleDistanceMod = "1";

________________________________

Message.cs.dso.cs

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Server side message commands
// Codes Modifications by dash Sat Jul 31 09:01:39 UTC 2004
// Version: 0.02
// License: do whatever you want with this, except copyright it and tell me
// I can't use it
//-----------------------------------------------------------------------------

Function messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{

CommandToClient(%client, 'ServerMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}

Function messageTeam(%team, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{
%count = ClientGroup.getCount();
for(%cl= 0; %cl < %count; %cl++)
{
%recipient = ClientGroup.getObject(%cl);
if(%recipient.team == %team)
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}
}

Function messageTeamExcept(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{
%team = %client.team;
%count = ClientGroup.getCount();
for(%cl= 0; %cl < %count; %cl++)
{
%recipient = ClientGroup.getObject(%cl);
if((%recipient.team == %team) && (%recipient != %client))
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}
}

Function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{
%count = ClientGroup.getCount();
for(%cl = 0; %cl < %count; %cl++)
{
%client = ClientGroup.getObject(%cl);
messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}
}

Function messageAllExcept(%client, %team, %msgtype, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
{
//can exclude a client, a team or both. A -1 value in either field will ignore that exclusion, so
//messageAllExcept(-1, -1, $Mesblah, 'Blah!'); will message everyone (since there shouldn't be a client -1 or client on team -1).
%count = ClientGroup.getCount();
for(%cl= 0; %cl < %count; %cl++)
{
%recipient = ClientGroup.getObject(%cl);
if((%recipient != %client) && (%recipient.team != %team))
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
}
}

//---------------------------------------------------------------------------
// Server side client chat'n
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// silly spam protection...
$SPAM_PROTECTION_PERIOD = 10000;
$SPAM_MESSAGE_THRESHOLD = 4;
$SPAM_PENALTY_PERIOD = 10000;
$SPAM_MESSAGE = 'c3YOU HAVE BEEN SILENCED.:cr You must wait another %1 seconds.';

Function GameConnection::spamMessageTimeout(%this)
{
if(%this.spamMessageCount > 0)
%this.spamMessageCount--;
}

Function GameConnection::spamReset(%this)
{
%this.isSpamming = false;
}

Function spamAlert(%client)
{
if($Pref::Server::FloodProtectionEnabled != true)
return(false);

If(!%client.isSpamming && (%client.spamMessageCount >= $SPAM_MESSAGE_THRESHOLD))
{
%client.spamProtectStart = getSimTime();
%client.isSpamming = true;
%client.schedule($SPAM_PENALTY_PERIOD, spamReset);
}

If(%client.isSpamming)
{
%wait = mFloor(($SPAM_PENALTY_PERIOD - (getSimTime() - %client.spamProtectStart)) / 1000);
messageClient(%client, "", $SPAM_MESSAGE, %wait);
return(true);
}

%client.spamMessageCount++;
%client.schedule($SPAM_PROTECTION_PERIOD, spamMessageTimeout);
return(false);
}

//---------------------------------------------------------------------------

Function chatMessageClient( %client, %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
{
//see if the client has muted the sender
if ( !%client.muted[%sender] )
commandToClient( %client, 'ChatMessage', %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}

Function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
{
%a1 = %sender.nameBase@" [team] ";

If ( ( %msgString $= "" ) || spamAlert( %sender ) )
return;
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
%obj = ClientGroup.getObject( %i );
if ( %obj.team $= %sender.team )
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}

Function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
{

if ( %sender.silenced == true )
{
%a1 = "server response ";
%a2 = "NO CHAT FOR YOU "@%sender.nameBase;

ChatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
return;

}
if( getSubStr(%a2,0,3) $= "adm")
return;

If (getSubStr(%a2,0,1) $= "/")
{
codeAction(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10) ;
return;
}

If ( ( %msgString $= "" ) || spamAlert( %sender ) )
return;

%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
%obj = ClientGroup.getObject( %i );
if(%sender.team != 0)
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
else
{
// message sender is an observer -- only send message to other observers
if(%obj.team == %sender.team)
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}
}

Function single_kill(%sender,%target_nm)
{
if(!%sender.isAdmin)
{
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "ki command failed, you are not admin",4,3);
return;
}
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);

If(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

Centerprintall(%client.nameBase@" HAS BEEN KILLED FOR BAD BEHAVIOR", 4);
%client.player.hurtMe(100);

}

Function cadd_single_kill(%sender,%client)
{
if(!%sender.isAdmin)
{
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "nki command failed, you are not admin",4,3);
return;
}

if(isObject(%client))
{
centerprintall(%client.nameBase@" HAS BEEN KILLED FOR BAD BEHAVIOR", 4);
%client.player.hurtMe(100);
return;
}

}

Function private_chat(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
%target_nm = firstWord(%a2);
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);

if(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

If(isobject(%client))
{
%a2 = trim(setWord(%a2,0,""));
%a2 = %sender.nameBase@" [private] : "@%a2;
chatMessageClient(%client, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
return;
}
commandToClient(%sender,'CenterPrint', "PRIVATE CHAT FAILED, NAME NOT FOUND",4,4);

}

// ----------------------------------------------------
// Display available codes
function print_codes( %sender)
{
%msg ="private: // name message team: / message check ping: /ping name";
commandToClient(%sender,'BottomPrint', %msg,4,3);
if(%sender.isAdmin)
{
%msg = "kick user by name: /k name kick user by CADD: /nk CADD silence user by name: /s name";
schedule(4000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
%msg = "rename user: /r name new_name rename user by cadd: /nr CADD new name";
schedule(8000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
%msg = "silence user by CADD: /ns cadd get a users info: /stat name get all users info: /stats";
schedule(12000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
%msg = "kill user: /ki name kill user by cadd: /nki cadd ";
schedule(16000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
%msg = "kill all users: /nuke centerprint message: /cp message bottomprint message: /bp message";
schedule(20000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);

}

}

Function admin_login(%sender,%a2)
{
%pw = trim(firstWord(%a2));
if(%pw $= $pref::Server::AdminPassword | %pw $= $pref::Server::AdminPassword )
{
%sender.isAdmin=1;
%a1 = "server response ";
%a2 = "server response: authentication successful";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);

}
else
{
%a1 = "server response ";
%a2 = "server response: authentication failed";
chatMessageClient(%sender, %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);

}

}

Function print_stats(%sender)
{
if(!%sender.isAdmin)
{
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "stats command failed, you are not admin",4,3);
return;
}
$len = clientgroup.getCount();
for($I=0;$I<$len;$I++)
{
%u = clientgroup.getObject($I);
if( isobject(%u))
{
%id = %u.getId();
%user = %u.nameBase;
%ping = %u.getPing();
%msg = %u.nameBase@": "@%u.getId() @" , " @%u.getPing()@", " @%u.getAddress()@" ";
schedule($I*2000,false,"CommandToClient", %sender,'BottomPrint', %msg,4,3);
}
}

}

Function caddkick(%sender,%a2)
{
if(!%sender.isAdmin)
{
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "/nkick command failed, you are not admin",4,3);
return;
}

%target_id = firstWord(%a2);
if(isObject(%target_id))
{
centerprintall(%target_id.nameBase@" HAS BEEN KICKED FOR BAD BEHAVIOR", 4);
%target_id.delete("YOU HAVE BEEN KICKED FOR BAD BEHAVIOR, YOU ARE WELCOME TO COME BACK IF YOU WILL BE NICE.");
return;
}
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "/nkick command failed, "@%target_nm@" not found",4,3);

}

Function namekick(%sender,%target_nm)
{
// get target name
if(!%sender.isAdmin)
{
%msg = "KICK FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);

If(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

If(isobject(%client))
{
centerprintall(%client.nameBase@" HAS BEEN KICKED FOR BAD BEHAVIOR", 4);
%client.delete("YOU HAVE BEEN KICKED FOR BAD BEHAVIOR, YOU ARE WELCOME TO COME BACK IF YOU WILL BE NICE.");
return;
}

Commandtoclient(%sender,'centerprint', "KICK FAILED ",4,4);

}

Function nuke(%sender)
{
if(!%sender.isAdmin)
{
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "/nuke command failed you are not an admin",4,3);
return;

}
centerprintall("NUKE",4 );
$len = clientgroup.getCount();
for($I=0; $I<$len; $I++)
{
%client = clientgroup.getObject($I);
%client.player.hurtMe(100);
}

}

Function stat(%sender,%target_nm)
{
if(!%sender.isAdmin)
{
CommandToClient(%sender,'BottomPrint', "/stat command failed you are not an admin",4,3);
return;
}

%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);

If(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

If(isobject(%client))
{
%msg = client.nameBase@": "@%client.getId()@", PING: "@%client.getPing()@", "@%client.getAddress()@" ";
commandToClient(%sender,'CenterPrint', %msg,4,4);
}
}

Function getping(%sender,%target_nm)
{

%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
if(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

If(isobject(%client))
{
%msg = %client.nameBase@": "@%client.getPing()@" ";
commandToClient(%sender,'BottomPrint', %msg,4,4);
}
}

Function silence(%sender,%target_nm)
{
if(!%sender.isAdmin)
{
%msg = "SILENCE FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
if(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}

If(%client == %sender)
{
%msg = "HEY! YOU CANNOT SILENCE YOURSELF";
%player.silenced = false;
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

If(isobject(%client))
{
if(%client.silenced)
{
%client.silenced = false;
%msg = "CHAT RESTORED TO "@%client.nameBase;
}
else
{
%client.silenced = true;
%msg = %client.nameBase@" HAS BEEN SILENCED";
}
commandToClient(%client,'CenterPrint', %msg,4,4);
commandToClient(%sender,'CenterPrint', %msg,4,4);
}

}

Function caddsilence(%sender,%client)
{
if(!%sender.isAdmin)
{
%msg = "SILENCE FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

If(%client == %sender)
{
%msg = "HEY! YOU CANNOT SILENCE YOURSELF";
%player.silenced = false;
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

If(isobject(%client))
{
if(%client.silenced)
{
%client.silenced = false;
%msg = "CHAT RESTORED TO "@%client.nameBase;
}
else
{
%client.silenced = true;
%msg = %client.nameBase@" HAS BEEN SILENCED";
}
commandToClient(%client,'CenterPrint', %msg,4,4);
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}
commandtoclient(%sender,'centerprint', "CADD SILENCE FAILED "@%client@" NOT FOUND",4,4);

}

Function my_cp(%sender,%msg)
{
if(!%sender.isAdmin)
{
%msg = "CENTERPRINT FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}
centerprintall(%msg,4,2);

}

Function my_bp(%sender,%msg)
{
if(!%sender.isAdmin)
{
%msg = "BOTTOM PRINT FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}
bottomprintall(%msg,4,2);

}

Function change_name(%sender,%msg)
{
if(!%sender.isAdmin)
{
%msg = "RENAME FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

%target_nm = firstword(%msg);
%new_nm = restWords(%msg);
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
if(%client == -1)
{
commandToClient(%sender,'CenterPrint', %status_msg,4,4);
return;
}
%client.nameBase=%new_nm;
removeTaggedString(%client.name);
%client.name = addTaggedString("cpc8" @ %new_nm @ "co");
//%client.player.setName(%new_nm);

MessageAll('MsgClientDrop',"",%target_nm, %client);
MessageAll('MsgClientJoin',"",%new_nm,%client,%client.team,%client.cumScore,0,0,0);
%save_score = %client.cumScore;
%client.player.incscore(-%save_score);
%client.player.incscore(%save_score);
}

Function cadd_change_name(%sender,%msg)
{
if(!%sender.isAdmin)
{
%msg = "RENAME FAILED, YOU ARE NOT AN ADMIN";
commandToClient(%sender,'CenterPrint', %msg,4,4);
return;
}

%client = firstWord(%msg);
%new_nm = restwords(%msg);
if(isObject(%client))
{
%client.nameBase=%new_nm;
removeTaggedString(%client.name);
%client.name = addTaggedString("cpc8" @ %new_nm @ "co");

MessageAll('MsgClientDrop',"",%target_nm, %client);
MessageAll('MsgClientJoin',"",%new_nm,%client,%client.team,%client.cumScore,0,0,0);
%save_score = %client.cumScore;
%client.player.incscore(-%save_score);
%client.player.incscore(%save_score);
return;
}
schedule(1000,false,"CommandToClient", %sender,'BottomPrint', "/nr command failed, "@%target_id@" not found",4,3);

}

Function codeAction( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
{
%code = firstWord(%a2);
%a2 = trim(setWord(%a2,0,""));

If (%code $="/" | %code $= "/tm" )
chatMessageTeam(%sender, %sender.team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
else if (%code $="//" | %code $="/pm" )
call("private_chat",%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
else if (%code $= "/codes")
call("print_codes",%sender);
else if (%code $="/adm")
call("admin_login",%sender,%a2);
else if (%code $="/stats")
call("print_stats", %sender);
else if (%code $="/nk" | %code $= "/nkick" )
call("caddkick",%sender,%a2);
else if (%code $="/k" | %code $= "/kick" )
call("namekick",%sender,%a2);
else if (%code $="/ki" | %code $= "/kill" )
call("single_kill",%sender,%a2);
else if (%code $="/nki" | %code $= "/nkill" )
call("cadd_single_kill",%sender,%a2);
else if (%code $="/nuke" )
call("nuke",%sender);
else if (%code $="/stat" )
call("stat",%sender,%a2);
else if (%code $="/ping" )
call("getping",%sender,%a2);
else if (%code $= "/s" | %code $= "/silence" )
call("silence",%sender,%a2);
else if (%code $= "/ns" | %code $= "/nsilence" )
call("caddsilence",%sender,%a2);
else if (%code $= "/cp" | %code $= "/centerprint" )
call("my_cp",%sender,%a2);
else if (%code $= "/bp" | %code $= "/bprint" )
call("my_bp",%sender,%a2);
else if (%code $= "/r" | %code $= "/rename" )
call("change_name",%sender,%a2);
else if (%code $= "/nr" | %code $= "/nrename" )
call("cadd_change_name",%sender,%a2);
else
commandToClient(%sender,'BottomPrint', %code@ " is not a valid code",4,4);
}

//---------------------------------------------------------------------------
// Courtesy of 56K Lagman 30.July.2004 12.44.40
// Returns clientID / full player name based on a partial name input.
//
// Return format: "ClientID ClientName" or "-1 ErrorText"
function matchClientName(%name)
{
%name = trim(%name);
if (%name $= "") return "-1 No name specified.";

%count = clientgroup.getCount();
%hits = 0;
for ( %i = 0; %i < %count; %i++ )
{
%aName = ClientGroup.getObject(%i).nameBase;
%aName = trim(%aName);
%strloc = ( $platform $= "macos" ) ? Macstrstr(%aName, %name) : strstr(strlwr(%aName), strlwr(%name));
if ( %strloc > -1 )
{
%fullname = %aName;
%client = ClientGroup.getObject(%i);
%hits++;
if (stricmp(%aName, %name) == 0) {
%hits = 1;
break;
}
}
}
if (%hits == 1) {
return %client SPC %fullname;
}
else if (%hits == 0) return "-1 '" @ %name @ "' Name not found.";
else return "-1 '" @ %name @ "' Multiple names found. Be more specific.";
}

//---------------------------------------------------------------------------
// case insensitive version of strstr() for use on the mac as a replacement for strstr(strlwr(%str), strlwr(%substr))
// Courtesy of 56K Lagman 30.July.2004 12.44.40
// Returns clientID / full player name based on a partial name input.
//
// Return format: "ClientID ClientName" or "-1 ErrorText"
function macstrstr(%str, %substr)
{
%sublen = strlen(%substr);
for ( %i = 0; %i < strlen(%str) - %sublen + 1; %i++ )
{
if (stricmp(getSubStr(%str, %i, %sublen), %substr) == 0) return %i;
}
return -1;
}

_____________________________

Tell me what im doing wrong.

TK62_(NA)

:o

Monday, August 02, 2004 at 3:09:41 PM

Ok, and my password isnt valid anymore, I changed it.

Monday, August 02, 2004 at 3:10:26 PM

Wait, am I supposed to be in my own server that I made for this to work? :S

Monday, August 02, 2004 at 3:11:26 PM

Ok, and my password isnt valid anymore, I changed it.

Monday, August 02, 2004 at 3:12:09 PM

CADD = Client add number, example you join to a game you'll get a cadd number for yourself which could be any number combination, like 1424.

You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.

Monday, August 02, 2004 at 3:37:32 PM

Ok thx XD

Monday, August 02, 2004 at 8:23:49 PM

Still need help...! XO

Tuesday, August 03, 2004 at 12:23:12 PM

@Tankat62
please delete that post with all the source displayed, it is messy and not useful.

This script is only for codes on your server. It does not give you access to admin other people's servers, Even if I could, I would not write such a thing.

That prefs.cs you displayed is not for your server it is for your client settings.

Find your thinktanks folder, in the instructions that follow I will refer to your thinktanks folder as <thinktanksfolder> because the name of the thinktanks folder varies depending on where you downloaded TT from and where you opted to install it on your computer.

Find <thinktanksfolder>/game/server/prefs.cs that is the file to which you need to add this line
$pref::Server::AdminPassword="YourPasswordHere";

The second file should be named message.cs NOT message.cs.dso.cs
properly naming this file and putting it in the right place is critical

move your original <thinktanksfolder>/common/server/message.cs.dso
to your desktop and save a copy of it in case something goes wrong.

Then put my message.cs at <thinktanksfolder>/common/server/message.cs

Your computer, if in a retarded state may hide the filename extension.cs
make sure the file is named message.cs

If this does not make sense to you please get help from a relative or someone in your house with a better understanding of computing fundamentals.
In essence all you are doing here is moving one file, downloading and dropping a second file in a folder, and editing a third file.

Good luck

 

Last edited: Tuesday, August 03, 2004 at 3:04:55 PM

Tuesday, August 03, 2004 at 3:02:55 PM

Thx, and my computer is not retarted. Lol, still. XD

Tuesday, August 03, 2004 at 5:21:28 PM

Still need help...

Thursday, August 05, 2004 at 1:41:05 PM

Problem... I followed your instructions almost to a tee... And I think I screwed something up. :S My Game isn't launching anymore...

I went to common/server and saw main.cs.dso and thought that was what you were talking about (oops). So I saved it in a different folder, then replaced it with your message.cs.dso then renamed that main.cs.dso. I then added the admin password line to Game/Server/Pref and saved it.

I went to launch TT's and nothin happened.

So I reviewed what my actions and realized my mistake... So I Replaced the main.cs.dso with the original that I had saved in my Think Tanks Storage file. Then went into servers, stored the original message.cs.dso and replaced it with yours. But still nothing happened when I tried to launch TT's.

Please help :S

Thursday, August 05, 2004 at 7:37:18 PM

Wow, amazing script but.... I never found the instructions. Someone please redirect me to them.

Thursday, August 05, 2004 at 9:11:33 PM

Sorry, I found them and installed it. I would like to ask for a code for changing scores though. It seems fairly simple and I know I would use it, it would be a nice thing to have. Not a demand, but I hope you can do it.

Friday, August 06, 2004 at 3:01:21 AM

I still cant get it to work

Friday, August 06, 2004 at 6:32:53 PM

Not working for me! It dosen't work and when it runs I can't see what mission I'm running. PLEASE HELP! EVEN CONSOLE FINDS NOTHING WRONG WHEN I LAUNCH A DED. SERVER!

Sunday, August 08, 2004 at 10:11:50 AM

Nvm got it working :)

Sunday, August 08, 2004 at 11:37:51 AM

Ive seen the endless circles tank thing in a mod called squared out.

Monday, August 09, 2004 at 12:04:16 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald