Information for Scriptors

Adding new Codes
Adding new Codes to ACASv3 is very easy.
You just need to create a "*.cs" or a "*.dso" file in the Codes folder and it'll be loaded automatically.
Then, to get the script to recognize it as a code, you need to add these lines ONCE PER CODE:

$ACAS::CodesFolder::Function[NUM] = "FUNCTIONNAME";
$ACAS::CodesFolder::Shortcut[NUM] = "CODE";
$ACAS::CodesFolder::Description[NUM] = "DESCRIPTION";
$ACAS::CodesFolder::GuiArgs[NUM] = "GUIARGUMENTS";


And an optional one:
$ACAS::CodesFolder::ExtraArg[NUM] = "EXTRAARGUMENT";

Syntax:
NUMNumber of the code, Start at #0 and everytime you add a new code, add one to this number for the variables RELATED to the code
FUNCTIONNAMEThe function to be called when the code is used
CODEThe chat shortcut to be used, ex: "/kick"
DESCRIPTIONThe Text shown in the Options and in the in-game GUI
GUIARGUMENTSWhat you want the GUI to ask the user. Separate each Argument with an "@".
Possible Values:
SelectedPlayer - Sends the CADD of the currently Selected Player
EnterTerm:MSG - Let's the player enter a Message (Spaces not allowed)
EnterTermSpace:MSG - Let's the player enter a Message (Spaces allowed)
EnterTermNumber:MSG - Let's the player enter a Number
DONOTINCLUDE - Does not include the code in the in-game GUI (Must be the First Argument)

Replace "MSG" with the Message you want the script to show in the window while entering a text. (don't forget the ":")
Ex:
"SelectedPlayer@EnterTermNumber:Enter the points to give to the player (Numbers Only)"
EXTRAARGUMENTAn extra Argument to be sent to the Function
Ex: "LightTank"


The function FUNCTIONNAME is then called using this syntax:
FUNCTIONNAME(SENDER,MESSAGE,EXTRAARGUMENT,MSGSTRING);

Where SENDER is the CADD of who sent the Message, MESSAGE the message itself (without the "/" code), EXTRAARGUMENT the EXTRAARGUMENT you selected (if you did) and MSGSTRING for advanced Message Sending (PM/TM).

For example, the "/kill" command would look like this (fully functioning with GUI included):


$ACAS::CodesFolder::Function[0] = "killplayer";
$ACAS::CodesFolder::Shortcut[0] = "/kill";
$ACAS::CodesFolder::Description[0] = "Kill Player";
$ACAS::CodesFolder::GuiArgs[0] = "SelectedPlayer";

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

    %client.player.hurtMe(99999999999);
    centerprintall(%client.namebase SPC $ACAS::Messages::OnKillToAll,4,4);
}
2007 - Everything in this website has been made by me and if you place it anywhere else, you must include credits to me and a link to this page