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

Quote:
Originally Posted by Rajat_Pawar
View Post
From what I see, hard work, and for that, first of all, congrats. But, I probably didn't get this much since you didn't explain much. On your note that it reduces the 'hassle' of a lot of code under one call back, I find (personal opinion) it quite easier to group all checkpoint checks under one callback rather than two for each. So can you explain a bit more about this?
It goes like this....

Code:
#include <dynamiccp>

public OnGameModeInit()
{
      AddDynamicCP(1000.0, 1000.0, 1000.0, 2.0, "TestCP1")
      AddDynamicCP(1000.0, 1000.0, 1000.0, 2.0, "TestCP2")
      AddDynamicCP(1000.0, 1000.0, 1000.0, 2.0, "TestCP3")
      AddDynamicCP(1000.0, 1000.0, 1000.0, 2.0, "TestCP4")

}

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

OnCheckPoint:TestCP2(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You entered the TestCP2");
      return 1;
}

ExitCheckPoint:TestCP2(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You left the TestCP2");
      return 1;
}

OnCheckPoint:TestCP3(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You entered the TestCP3");
      return 1;
}

ExitCheckPoint:TestCP3(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You left the TestCP3");
      return 1;
}

OnCheckPoint:TestCP4(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You entered the TestCP4");
      return 1;
}

ExitCheckPoint:TestCP4(playerid, cpid, cpindex)
{
      SendClientMessage(playerid, "You left the TestCP4");
      return 1;
}
In this manner if your using includes in your gamemode there is no need for hooking or tossing everything in one place you can initialize a checkpoint / area anywhere and have the macro called anywhere.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)