[Include] Checkpoint / Area sub-streamer for incognito's streamer plugin
#8

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
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;
}
to

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;
}
Or if you won't, it is better to change the names, like:

OnCheckPoint and OffCheckPoint
or
EnterCheckPoint and ExitCheckPoint
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)