How to get checkpoint id's.
#1

i'm aware i most likely need to assign a checkpoint id somehow.

pawn Код:
public OnPlayerConnect(playerid)
{
    //other sutff.
    CreateDynamicCP(-2024.0315, 395.4877, 35.1719, 1.0, -1,-1, -1, 20.0);
    CreateDynamicCP(284.7085, -41.5060, 1001.5156, 1.0, -1,-1, -1, 20.0); //thinking setting 2 checkpoints at the same time could be causing it to bug.
    return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    OnPlayerEnterDynamicCP(playerid, checkpointid);
    {
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
        SetPlayerInterior(playerid, 1);
        inammu[playerid] = 1;
    }
    OnPlayerEnterDynamicCP(playerid, checkpointid);
    {
        SetPlayerInterior(playerid, 0);
        inammu[playerid] = 0;
        leaveammu(playerid);
    }
    return 1;
}
Thanks in advance.
Reply
#2

pawn Код:
new checkpoint1;
new checkpoint2;

public OnPlayerConnect(playerid)
{
    //other sutff.
    checkpoint1 = CreateDynamicCP(-2024.0315, 395.4877, 35.1719, 1.0, -1,-1, -1, 20.0);
    checkpoint2 = CreateDynamicCP(284.7085, -41.5060, 1001.5156, 1.0, -1,-1, -1, 20.0); //thinking setting 2 checkpoints at the same time could be causing it to bug.
    return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == checkpoint1)
    {
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);
        SetPlayerInterior(playerid, 1);
        inammu[playerid] = 1;
    }
    if(checkpointid == checkpoint1)
    {
        SetPlayerInterior(playerid, 0);
        inammu[playerid] = 0;
        leaveammu(playerid);
    }
    return 1;
}
Reply
#3

Works like a charm, thanks man.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)