My Checkpoint problem [HELP] +REP
#1

I used Streamer plugin to make the multiple checkpoint
like this..i want when the player touched the checkpoint. that marker will dissapear and the player will be teleported to the interior like the basic checkpoint function. i want when player touched the checkpoint.. the checkpoint goes dissapear and will reepear after player not touched it.. can you help me? heres my code.. kinda sleepy...

Код:
new LsGym;
new LsGymExit;
Код:
public OnGameModeInit()

LsGym = CreateDynamicCP(2229.5120, -1721.5774, 13.5642,3, -1,-1,-1,100.0);
    LsGymExit = CreateDynamicCP(772.2743, -5.5152, 1000.7284,3, -1,-1,-1,100.0);
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
   if(checkpointid == LsGym) //ls gym
	{
		SetPlayerInterior(playerid, 5);
		SetPlayerPos(playerid, 771.3447, -1.3051, 1000.7275);
		
	}
	if(checkpointid == LsGymExit) //ls gym exit
	{
	  SetPlayerInterior(playerid, 0);
	  SetPlayerPos(playerid, 2229.5120, -1721.5774, 13.5642);
	}
	return 1;
}
Reply
#2

Hi Chausar,

You never really specified exactly what the problem was. However I have looked over your code and made some adjustments and the tested end result is below. I changed some co-ordinates as the first error I experienced was that with your co-ordinates (positions at SetPlayerPos) that the player would continually spawn at both checkpoints therefore creating an endless loop of teleporting to and from both checkpoints.

I have also added under OnGameModeInit, DisableInteriorEnterExits(); which will disable all the interior entrances and exits in the game (the yellow arrows at doors). As I found that there was a yellow marker also at the location of your checkpoint which sometimes would interfere with the positioning of your SetPlayerPos.

pawn Код:
new LsGym;
new LsGymExit;

public OnGameModeInit()
{
    DisableInteriorEnterExits();
    LsGym = CreateDynamicCP(2229.5120, -1721.5774, 13.5642,3, -1,-1,-1,100.0);
        LsGymExit = CreateDynamicCP(772.2743, -5.5152, 1000.7284, 3, -1, 5, -1, 100.0);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == LsGym)
    {
            SetPlayerInterior(playerid, 5);
            SetPlayerPos(playerid, 772.2174, -2.0610, 1000.7283);
            SetPlayerFacingAngle(playerid, 358.6013);
    }
    else if(checkpointid == LsGymExit)
    {
            SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 2226.8406, -1723.6810, 13.5517);
        SetPlayerFacingAngle(playerid, 132.9992);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)