SA-MP Forums Archive
EnterCheckpoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: EnterCheckpoint (/showthread.php?tid=403520)



EnterCheckpoint - NicholasA - 30.12.2012

Hey i need help with OnPlayerEnterCheckpoint
so i got 2 checkpoints but how do i make it so that it only does those things when he enters a specific checkpoint.
like:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  cp1 = SendClientMessage(playerid, 0x3524C9FF, "(( [Lumberjack] Deliver the logs to the HQ to receive your paycheck! ))");
  SetPlayerCheckpoint(playerid, 848.1696,-1445.7803,13.5762, 5.0);
    return 1;
}



Re : EnterCheckpoint - DaRk_RaiN - 30.12.2012

Use a streamer.


Re: Re : EnterCheckpoint - NicholasA - 30.12.2012

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Use a streamer.
More detail


AW: Re : EnterCheckpoint - Nero_3D - 30.12.2012

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Use a streamer.
to complete your sentence

Use a streamer ... if you want multiply checkpoints at the same time

Otherwise just assign each checkpoint an id

pawn Код:
enum {
    CP_PAYCHECK,
    CP_PAYCHECK_2
}

stock
    gPlayerCheckpoint[MAX_PLAYERS char]
;
pawn Код:
stock SetPlayerCheckpointEx(playerid, const checkpointid, Float: X, Float: Y, Float: Z, Float: size){
    gPlayerCheckpoint{playerid} = checkpointid;
    return SetPlayerCheckpoint(playerid, X, Y, Z, size);
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    switch(gPlayerCheckpoint{playerid})
    {
        case CP_PAYCHECK:
        {
            SendClientMessage(playerid, 0x3524C9FF, "(( [Lumberjack] Deliver the logs to the HQ to receive your paycheck! ))");
            SetPlayerCheckpointEx(playerid, CP_PAYCHECK_2, 848.1696,-1445.7803,13.5762, 5.0);
        }
        case CP_PAYCHECK_2:
        {
            SendClientMessage(playerid, 0x3524C9FF, "(( [Lumberjack] Delivery completed, paycheck received! ))");
            DisablePlayerCheckpoint(playerid);
        }
    }
    return true;
}



Re: EnterCheckpoint - RedCrossER - 30.12.2012

Using a streamer Plugin would best solution for this. Search in Plugin Section for Streamer.