21.03.2014, 14:01
Why don't you combine callbacks as one and add a parameter to see if player entered or leaved area/checkpoint?
It is better to have one callback per area/checkpoint, like commands or dynamic dialogs.
From
to
Or if you won't, it is better to change the names, like:
OnCheckPoint and OffCheckPoint
or
EnterCheckPoint and ExitCheckPoint
It is better to have one callback per area/checkpoint, like commands or dynamic dialogs.
From
Code:
OnCheckPoint:TestCP1(playerid, cpid, cpindex) { SendClientMessage(playerid, "You entered the TestCP1"); return 1; } ExitCheckPoint:TestCP1(playerid, cpid, cpindex) { SendClientMessage(playerid, "You left the TestCP1"); return 1; }
Code:
OnCheckPoint:TestCP1(playerid, cpid, cpindex,state) { if(state == STATE_ENTER) SendClientMessage(playerid, "You entered the TestCP1"); else if(state == STATE_EXIT) SendClientMessage(playerid, "You left the TestCP1"); return 1; }
OnCheckPoint and OffCheckPoint
or
EnterCheckPoint and ExitCheckPoint