29.03.2009, 00:14
[3Play : Checkpoint Streamer Library]
Include File Features:- Simple Checkpoint Streaming
- Optimized Scripting Method
- Advanced Checkpoint Options (Interior, Virtual World, Owner)
- Single User Checkpoint Streaming
- The simpliest Checkpoint Identifier ever
How does it work?
In the following example, I will create a simple bank checkpoint inside the City Planning Dpt. at Las Venturas
1. We need the include statement at the top of the script in order to include the CheckpointManager.inc
pawn Код:
#include <a_samp>
#include <CheckpointManager>
pawn Код:
// Checkpoint Definitions
#define BANK_CITYPLANNING 0
pawn Код:
// Add Checkpoints
// Note: GLOBAL_OWNER_ID is defined at CheckpointManager.inc as -1
CreateCheckpoint(GLOBAL_OWNER_ID, BANK_CITYPLANNING, 362.2479, 173.5770, 1008.3828);
SetCheckpointInterior(BANK_CITYPLANNING, 3);
// Initializing the CheckpointManager
StartCheckpointSeeking();
(...)
pawn Код:
public OnPlayerEnterCheckpoint(playerid){
VerifyCheckpoint(playerid); // Asks the ChpManager to check this checkpoint and fire the next function
return 1;
}
pawn Код:
public OnCheckpointEnter(playerid, checkpointid){
switch(checkpointid)
{
// BANKS
case BANK_CITYPLANNING: // The checkpoint ID we specified when we created the checkpoint
{
SendClientMessage(playerid, COLOR_MESSAGE, "Welcome to the San Andreas Bank");
SendClientMessage(playerid, COLOR_MESSAGE, "To deposit money type «/bank deposit [ammount]»");
SendClientMessage(playerid, COLOR_MESSAGE, "To withraw money type «/bank withraw [ammount]»");
SendClientMessage(playerid, COLOR_MESSAGE, "To request a loan type «/bank loan [ammount]»");
}
}
return 1;
}
Functions Included:
CreateCheckpoint(ownerid, chpid, FloatosX, FloatosY, FloatosZ); Creates a checkpoint
SetCheckpointInterior(chpid, interiorid); Sets the checkpoint interior
SetCheckpointVirtualWorld(chpid, VirtualWorldID); Sets the checkpoint virtual world
ToggleCheckpointActive(chpid, bool:active); Makes the checkpoint active or innactive
ChangeCheckpointOwner(chpid, owner); Changes the checkpoint owner
RemoveCheckpoint(chpid); Removes a checkpoint
StartCheckpointSeeking(); Makes the manager start seeking for nearby checkpoints
StopCheckpointSeeking(); Makes the manager stop seeking for nearby checkpoints
VerifyCheckpoint(playerid); Must be called at OnPlayerEnterCheckpoint
Source Download:
Version 0.1.1b
- Fixed a major Checkpoint Streaming Bug. Download please