YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

function with tag result used before definition, forcing reparse

Open MatheusAgL opened this issue 4 years ago • 1 comments

I'm getting this message in all my 'timer' codes after plugin update.

Example:

timer t_inviteEvento[150](playerid)
{
	if (percetInviteEvento[playerid] >= 100.0)
	{
        HideTextInviteEvento(playerid);
        stop timerInviteEvento[playerid];
    }
	else
        percetInviteEvento[playerid]++; 

	return true;
}

MatheusAgL avatar Dec 10 '21 07:12 MatheusAgL

The timer must be declared before calling defer.

i.e

// declaration
timer t_inviteEvento[150](playerid)
{
    if (percetInviteEvento[playerid] >= 100.0)
    {
        HideTextInviteEvento(playerid);
        stop timerInviteEvento[playerid];
    }
    else 
    {
        percetInviteEvento[playerid]++; 
    }
    return true;
}

// call
defer t_inviteEvento(playerid);

PatrickGTR avatar Jan 07 '22 16:01 PatrickGTR