05.01.2015, 19:09
Hello,
I am running into a problem when I'm using checkpoints.
I am not getting a pawno error, everything compiles fine.
What im basically trying to do is, that I want to make two cp. Player run into one cp, and then he gets teleported to the next cp's location, but instead of getting spawned back to cp1, he should stay in cp2 and if he runs into cp 2 he should go to cp 1 if you get it?
My code is basically:
As you can see this will just go as a loop, but I want to controle it, as i tried to describe above.
I am running into a problem when I'm using checkpoints.
I am not getting a pawno error, everything compiles fine.
What im basically trying to do is, that I want to make two cp. Player run into one cp, and then he gets teleported to the next cp's location, but instead of getting spawned back to cp1, he should stay in cp2 and if he runs into cp 2 he should go to cp 1 if you get it?
My code is basically:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == h[1])//Enter
{
SetPlayerPos(playerid, 238.727615, 138.634033, 1003.023437);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid, 3);
}
if(checkpointid == h[2]) //Exit
{
SetPlayerPos(playerid, 2287.032958, 2432.367187, 10.820312);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid, 0);
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == h[1])//Enter
{
}
if(checkpointid == h[2]) //Exit
{
}
return 1;
}