You can leave the function declaration above the void main() of the event code, or you can place it into an include. If you are going to change the max values often, remember all scripts will need to be updated, whether they have this function in the actual script or are referencing it from an include. Also, when a function is inside an include it gets declared once and defined once in order to use elsewhere.
For instance, my function would be presented as below in an include file:
// Summary of function goes here. Use
// a double slash before each line
// This enables the summary to be displayed
// in the bottom window of NWScript
int GetArmorMaxAC(object oArmor);
int GetArmorMaxAC(object oArmor)
{
//Contents of function go here.
}
Modifié par WhiZard, 07 novembre 2013 - 08:04 .