03.09.2012, 22:46
Hello everybody, I've tried to play around with Dynamic Checkpoints but I've got a problem. When I create a new checkpoint it is not called by OnPlayerEnterDynamicCP callback. If I try to create a new checkpoint doesn't show anything but....if I go back to the checkpoint previously created it works. Same thing if I create more checkpoints....In simple words the new checkpoint is not called.
Am I doing something wrong?
pawn Код:
#define MAX_COUNTER 10
new Iterator: CheckCounter<MAX_COUNTER>, miID, miCheckpoint;
stock CreateMyCheck(Float: X, Float: Y, Float: Z)
{
MyCheck[miID][mID] = miID;
MyCheck[miID][mX] = X;
MyCheck[miID][mY] = Y;
MyCheck[miID][mZ] = Z;
Iter_Add(CheckCounter, miID);
miCheckpoint = CreateDynamicCP(X,Y,Z, 1.5);
++ miID;
miCheckpoint ++;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
foreach(CheckCounter, x)
{
if(checkpointid == x)
{
SendClientFormatMessage(playerid, -1, "checkpoint %d", x);
break;
}
}
return 1;
}