playerEnterCheckpoint

From IV:MP Wiki

Jump to: navigation, search

This event is triggered when a player enters a checkpoint.

Parameters

Example

This example continues the code shown in createCheckpoint.

local checkpoint;
function addCheckpoint()
{
    checkpoint = createCheckpoint(6, -766.069,1407.84,1.48285, -740.31,1500.74,2.42586, 1.0);
}
addEvent("scriptInit", addCheckpoint);

function onPlayerEnterCheckpoint(playerid, checkpointId)
{
    if(checkpointId == checkpoint)
    {
        sendPlayerMessage(playerid, "You entered the checkpoint!", 0xFF0000FF, false);
    }
    return 1;
}
addEvent("playerEnterCheckpoint", onPlayerEnterCheckpoint);

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Server
Client
Scripting
Toolbox