Function error
#1

pawn Код:
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]);
        }
    }
}
In the /duty cmd:

pawn Код:
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...
    }
Getting this errors:

Quote:

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

Reply


Messages In This Thread
Function error - by SymonClash - 19.03.2019, 14:21
Re: Function error - by SymonClash - 19.03.2019, 14:40
Re: Function error - by SymonClash - 19.03.2019, 14:47
Re: Function error - by SymonClash - 19.03.2019, 19:59

Forum Jump:


Users browsing this thread: 2 Guest(s)