////////////////////////////////////////////////////////////
// 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();");
}
////////////////////////////////////////////////////////////
// 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();");
}
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);
}
}
//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 = "";
}
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
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 );
}
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";
}
function after::onClientMessage( %cl, %msg, %type )
after onClientMessage
{
switch( %type )
{
case 0: // white
%ret = false;
}
}
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;
}