EnterCheckpoint
#1

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;
}
Reply
#2

Use a streamer.
Reply
#3

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

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;
}
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)