I'm trying to add a callback to a function I've designed which does some asynchronous actions. Using the example from Timers, I create a typedef:
HTML Code:
typeset ActionCallback {
function void(float actions[2]);
}
And then I have a function attached to a methodmap which tries to call this "ActionCallback":
HTML Code:
public void Save(ActionCallback callback) {
int test[2];
test[0] = 2;
test[1] = 1;
callback(test);
}
Unfortunately, at the moment I'm getting a variety of errors that I have no idea how to solve. Namely:
C:\Users\\Documents\GitHub\ttt_sourcemod\rewr ite\includes\player_actions.inc(47) : error 012: invalid function call, not a valid address
C:\Users\\Documents\GitHub\ttt_sourcemod\rewr ite\includes\player_actions.inc(47) : warning 215: expression has no effect
C:\Users\\Documents\GitHub\ttt_sourcemod\rewr ite\includes\player_actions.inc(47) : error 001: expected token: ";", but found ")"
C:\Users\\Documents\GitHub\ttt_sourcemod\rewr ite\includes\player_actions.inc(47) : error 029: invalid expression, assumed zero
C:\Users\\Documents\GitHub\ttt_sourcemod\rewr ite\includes\player_actions.inc(47) : fatal error 190: too many error messages on one line
Does anyone know why my callback is not being identified as a function?