[Include] Simple Checkpoint Streamer
#1

[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>
2. Here I will define a number that identifies my Checkpoint right next to the includes
pawn Код:
// Checkpoint Definitions
#define BANK_CITYPLANNING        0
3. Somewhere inside GameModeInit, I will create my checkpoint and set its interior to 3 (City Planning Dpt Interior ID)
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();
    (...)
4. Very important: You need to call "VerifyCheckpoint" method at OnPlayerEnterCheckpoint. Like this:
pawn Код:
public OnPlayerEnterCheckpoint(playerid){
    VerifyCheckpoint(playerid); // Asks the ChpManager to check this checkpoint and fire the next function
    return 1;
}
This will make the ChpManager check which checkpoint the player has entered and fire a more specified function:
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;
}
Simple isn't it?

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
Reply


Messages In This Thread
[Include] Simple Checkpoint Streamer - by -zriptarusk - 29.03.2009, 00:14
Re: [Include] Simple Checkpoint Manager - by Oxside - 03.04.2009, 15:50
Re: [Include] Simple Checkpoint Manager - by T RP [Tomorrows-RP.co.uk] - 03.04.2009, 19:42
Re: [Include] Simple Checkpoint Manager - by -zriptarusk - 03.04.2009, 21:25
Re: [Include] Simple Checkpoint Manager - by MazaHACKa - 09.04.2009, 12:43
Re: [Include] Simple Checkpoint Streamer - by cristab - 14.06.2009, 10:02
Re: [Include] Simple Checkpoint Streamer - by mr.b - 10.09.2009, 06:11
Re: [Include] Simple Checkpoint Streamer - by Blantas - 10.09.2009, 12:33
Re: [Include] Simple Checkpoint Streamer - by Calgon - 10.09.2009, 12:36
Re: [Include] Simple Checkpoint Streamer - by mr.b - 10.09.2009, 19:17
Re: [Include] Simple Checkpoint Streamer - by Jakku - 12.09.2009, 18:38
Re: [Include] Simple Checkpoint Streamer - by mr.b - 13.09.2009, 04:55
Re: [Include] Simple Checkpoint Streamer - by mr.b - 13.09.2009, 06:26
Re: [Include] Simple Checkpoint Streamer - by Blantas - 13.09.2009, 06:33
Re: [Include] Simple Checkpoint Streamer - by Jakku - 13.09.2009, 06:43
Re: [Include] Simple Checkpoint Streamer - by mr.b - 13.09.2009, 07:02
Re: [Include] Simple Checkpoint Streamer - by mihais17 - 13.09.2009, 07:05
Re: [Include] Simple Checkpoint Streamer - by Jakku - 13.09.2009, 09:00
Re: [Include] Simple Checkpoint Streamer - by Jakku - 14.09.2009, 14:26
Re: [Include] Simple Checkpoint Streamer - by [XST]O_x - 21.09.2009, 16:29
Re: [Include] Simple Checkpoint Streamer - by [XST]O_x - 21.09.2009, 17:43
Re: [Include] Simple Checkpoint Streamer - by [03]Garsino - 28.10.2009, 19:54
Re: [Include] Simple Checkpoint Streamer - by [03]Garsino - 28.10.2009, 20:17
Re: [Include] Simple Checkpoint Streamer - by DJDhan - 11.12.2009, 13:04
Re: [Include] Simple Checkpoint Streamer - by DJDhan - 11.12.2009, 15:13
Re: [Include] Simple Checkpoint Streamer - by Oxside - 26.12.2009, 16:44
Re: [Include] Simple Checkpoint Streamer - by [Bm]rap45 - 04.02.2010, 04:37
Re: [Include] Simple Checkpoint Streamer - by TheInnocentOne - 16.02.2010, 06:42
Re: [Include] Simple Checkpoint Streamer - by -zriptarusk - 16.02.2010, 11:18
Re: [Include] Simple Checkpoint Streamer - by TheInnocentOne - 18.02.2010, 02:33
Re: [Include] Simple Checkpoint Streamer - by Stgnature - 27.02.2014, 15:38
Re: [Include] Simple Checkpoint Streamer - by Gnabry - 27.02.2014, 16:03
Re: [Include] Simple Checkpoint Streamer - by laser50 - 03.07.2014, 15:08
Re: [Include] Simple Checkpoint Streamer - by Stinged - 03.07.2014, 15:37
Re: [Include] Simple Checkpoint Streamer - by greentarch - 03.07.2014, 15:39
Re: [Include] Simple Checkpoint Streamer - by laser50 - 03.07.2014, 15:45
Re: [Include] Simple Checkpoint Streamer - by KayJ - 04.07.2014, 08:29
Re: [Include] Simple Checkpoint Streamer - by Stinged - 04.07.2014, 09:22

Forum Jump:


Users browsing this thread: 1 Guest(s)