AddGlobalVar("variablename") - Add a variable that is changed to all players in the multiplayer
SetGlobalVar("variablename", "value") - Set a global variable's value
GetGlobalVar("variablename") - Get a global variable's value
AddLocalVar("variablename") - Add a variable that only applies to this player
SetLocalVar("variablename") - Set a variable that only applies to this player
GetLocalVar("variablename", "playernum") - Get a local variable from the player with the player number
GlobalAttention() - Get the attention to activate a script in the acs with a return function called PlayerID()
eg.
script 1 globalattn
Also a choice function:
eg.
int TEAM_NUM[5] = {0, 1, 2, 3, 4};
str TEAM_NAME[5] = {"Red", "Blue", "Green", "Red", "Gold"};
int TEAM_COLOUR[5] = {CR_RED, CR_BLUE, CR_GREEN, CR_RED, CR_GOLD};
result = Choice(TEAM_NUM, TEAM_NAME, TEAM_COLOUR, "Choose your team");
Choice(int choiceval, str choiceappearance, int choicecolour, str choicetitle):
ChoiceVal - The values of the choices (like an enum)
ChoiceAppearand - The text that you see in the selection
ChoiceColour - The colour of the choice
ChoiceTitle - The title of the choice (eg. Choose your team)
Idea:
Code: Select all
#include "zcommon.acs"
script 1 enter
{
}
script 999 enter
{
int team;
int TEAM_NUM[5] = {0, 1, 2, 3, 4};
str TEAM_NAME[5] = {"Red", "Blue", "Green", "Red", "Gold"};
int TEAM_COLOUR[5] = {CR_RED, CR_BLUE, CR_GREEN, CR_RED, CR_GOLD};
team = Choice(TEAM_NUM, TEAM_NAME, TEAM_COLOUR, "Choose your team:");
AddLocalVar("Team");
SetLocalVar("Team", team);
AddLocalVar("HasFlag");
SetLocalVar("HasFlag", false);
}
...