stock SetAdminDuty(playerid, state)
{
switch(state)
{
case 1:
{
OnDuty[playerid] = 1;
SetPlayerHealth(playerid, FLOAT_INFINITY);
SCMTAEX(COLOR_YELLOW, "» %s (%d) is now on duty.", ReturnPlayerName(playerid), playerid);
SetPlayerColor(playerid, COLOR_YELLOW);
}
case 0:
{
OnDuty[playerid] = 0;
SetPlayerHealth(playerid, MAX_HEALTH);
SCMTAEX(COLOR_YELLOW, "» %s (%d) is now off duty.", ReturnPlayerName(playerid), playerid);
new col = random(sizeof (PlayerColors));
SetPlayerColor(playerid, PlayerColors[col]);
}
}
}
switch(OnDuty[playerid])
{
case 0: SetAdminDuty(playerid, 1); //Admin duty is off, enable it...
case 1: SetAdminDuty(playerid, 0); //Admin duty is on, disable it...
}
error 010: invalid function or declaration error 001: expected token: "-identifier-", but found ")" warning 202: number of arguments does not match definition warning 202: number of arguments does not match definition |
Name it something else, like `isOn`. Also, why are you using `switch` for true/false, and not using `bool:`? And `SCMTAEX` is the worst function name I've ever seen. Most functions should include at least a verb and a noun to tell you what they're operating on and what they're doing with it. That tells you nothing.
|