Scripts for Tribes 1.40

psychology and general common sense cannot be fixed on this forum

good luck 2 u

anyway is that really the complete code

ur missing a bracket at the bottom
 
try this
Code:
//////////////////////////////////////////////////////////// 
// File: CSki.cs 
// Author: Runar 
// Credits: 
// Info: Skiing
// 
//////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////// 

// * This is the "jump-delay" value. You may want to experiment 
// a bit with this. z0dd use's 0.001, Poop 0.07 and BigBunny 
// uses a value of 0.04. Default value is 0.0005. The lower the 
// value the more likely it will cause loss in FPS or even lag. 

$Jump:Delay = 0.04; 

// Don't touch this line 
editActionmap("playmap.sae"); 

// Edit this to bind you ski-key 
bindCommand(keyboard0, make, "lshift", TO, "Jump::Start();"); 
bindCommand(keyboard0, break, "lshift", TO, "Jump::Stop();"); 

//////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////// 

function Jump::Start() 
{ 
postAction(2048, IDACTION_MOVEUP, 1); 
postAction(2048, IDACTION_MOVEUP, 0); 
Schedule::Add("Jump::Start();", $Jump:Delay); 
} 

function Jump::Stop() 
{ 
Schedule::Cancel("Jump::Start();"); 
}
 
change:
postAction(2048, IDACTION_MOVEUP, 1);
postAction(2048, IDACTION_MOVEUP, 0);

to:
postAction(2048, IDACTION_MOVEUP, 0);
postAction(2048, IDACTION_MOVEUP, 1);

That will probably work.
 
To make it stop, add the commented line to Jump::Stop()
Code:
function Jump::Stop() 
{ 
  postAction(2048, IDACTION_MOVEUP, 0); // ADD THIS LINE
  Schedule::Cancel("Jump::Start();"); 
}
 
Code:
//////////////////////////////////////////////////////////// 
// File: CSki.cs 
// Author: Runar 
// Credits: 
// Info: Skiing
// 
//////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////// 

// * This is the "jump-delay" value. You may want to experiment 
// a bit with this. z0dd use's 0.001, Poop 0.07 and BigBunny 
// uses a value of 0.04. Default value is 0.0005. The lower the 
// value the more likely it will cause loss in FPS or even lag. 

$Jump:Delay = 0.04; 

// Don't touch this line 
editActionmap("playmap.sae"); 

// Edit this to bind you ski-key 
bindCommand(keyboard0, make, "lshift", TO, "Jump::Start();"); 
bindCommand(keyboard0, break, "lshift", TO, "Jump::Stop();"); 

//////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////// 

function Jump::Start() 
{ 
postAction(2048, IDACTION_MOVEUP, 0); 
postAction(2048, IDACTION_MOVEUP, 1); 
Schedule::Add("Jump::Start();", $Jump:Delay); 
} 

function Jump::Stop() 
{ 
postAction(2048, IDACTION_MOVEUP, 0); 
Schedule::Cancel("Jump::Start();"); 
}
 
Code:
Event::Attach(eventServerMessage,Events::ItemRecieved);

function Events::ItemRecieved(%msg)
{
	if(string::findSubStr(%msg, "You received ") != -1) {
		%substr = String::getSubStr(%msg, 13, 1024);
		%space = String::findSubStr(%substr, " ");
		%count = String::getSubStr(%substr, 0, %space);
		%item = String::getSubStr(%substr, %space+1, 1024);
		%nextspace = string::findSubStr(%item, " ");
		if(%nextspace > -1) {
			%lastword = string::getSubStr(%item, %nextspace+1, 1024);
			if(%lastword == "backpack")
				%item = string::getSubStr(%item, 0, %nextspace);
		}
		event::Trigger(eventItemReceived, %item, %count);
	}
}

Code:
//CheckWep
//Makes sure the weapon in hand, stays in hand.
//Event::Attach(eventItemReceived, "schedule::add(\"CheckWep::Check();\",0);");

Event::Attach(eventItemReceived,CheckWep::Check);

function CheckWep::Check(%item, %num) {
	$CheckWep::Current = GetMountedItem(0);
	Schedule::Add("CheckWep::Recheck();", 0.3);
}

function CheckWep::Recheck () {
	if(GetMountedItem(0) != $CheckWep::Current) {
	remoteEval(2048, UseItem, $CheckWep::Current);
	}
	$CheckWep::Current = "";
}


Thank you Poop and Smales
 
Code:
Event::Attach(eventServerMessage,Events::ItemRecieved);

function Events::ItemRecieved(%msg)
{
	if(string::findSubStr(%msg, "You received ") != -1) {
		%substr = String::getSubStr(%msg, 13, 1024);
		%space = String::findSubStr(%substr, " ");
		%count = String::getSubStr(%substr, 0, %space);
		%item = String::getSubStr(%substr, %space+1, 1024);
		%nextspace = string::findSubStr(%item, " ");
		if(%nextspace > -1) {
			%lastword = string::getSubStr(%item, %nextspace+1, 1024);
			if(%lastword == "backpack")
				%item = string::getSubStr(%item, 0, %nextspace);
		}
		event::Trigger(eventItemReceived, %item, %count);
	}
}



Thank you Poop and Smales

message parsing is :ugh:

is this for renegades?
 
Events::ItemRecieved

Received? :x

Has anyone made a mute script yet? I'd love to mute most of the white server messages. "Station Access" etc etc etc
 
Here is what I do.
Code:
function onClientMessage( %cl, %msg, %type ) {

	$muted = false;
		
	%index = String::findSubStr( %msg, "~" );
	
	if ( %index != -1 ) {
		%tags = String::getSubStr( %msg, %index + 1, 10000 );
		%msg = String::getSubStr( %msg, 0, %index );
	}
	
	eval( "messagetype" @ %type @ "( %client, %msg, %tags );" );
	
	return !$muted;
	
}

function messagetype0( %client, %msg, %tags ) {
	Event::Trigger( eventWhiteMessage, %msg, %tags );
}

function messagetype1( %client,%msg, %tags ) {
	Event::Trigger(eventRedMessage, %msg, %tags);
}

function messagetype2( %client, %msg, %tags ) {
	$lastClientMessage = %client;
	Event::Trigger( eventGlobalMessage, %client, %msg, %tags );
}

function messagetype3( %client, %msg, %tags ) {
	$lastClientMessage = %client;
	Event::Trigger( eventTeamMessage, %client, %msg, %tags );
}

function messagetype4( %client, %msg, %tags ) {
	Event::Trigger( eventCommandMessage, %client, %msg, %tags );
}

Code:
Event::Attach(eventWhiteMessage, WhiteMessage);
function WhiteMessage( %msg, %tags ) {

	if(String::findSubStr(%msg, $pcfg::name @ " scored a mid-air ") != -1)
		schedule::add("screenShot(\"mainWindow\");", 0.25);
		
	$muted="true";
	if( String::findSubStr(%msg, $pcfg::name) != -1 || String::findSubStr(%msg, "flag") != -1 || String::findSubStr(%msg, "mission") != -1 )
		$muted="false";
}
 
With 1.40, this is how I would do it:
Code:
function after::onClientMessage( %cl, %msg, %type )
  after onClientMessage
{  
  switch( %type )
  {
    case 0: // white
      %ret = false;
  }
}

If you're worried about losing mod-specific white-messages, you could use something similar to this:
Code:
function after::onClientMessage( %cl, %msg, %type )
  after onClientMessage
{ 
  %mute_msg["Match Started"] = true; 
  %mute_msg["Station Access On"] = true; 
  %mute_msg["Station Access Off"] = true;
  %mute_msg["Resupply Complete"] = true; 
  
  if(%type == 0 && %mute_msg[%msg])
    %ret = false;
}
 
Back
Top