SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 29/03/2009, 12:14 AM   #1
-zriptarusk
Big Clucker
 
Join Date: Mar 2009
Location: Praia da Vitória, Azores
Posts: 72
Reputation: 5
Default [Include] Simple Checkpoint Streamer

[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 Code:
#include <a_samp>
#include <CheckpointManager>

2. Here I will define a number that identifies my Checkpoint right next to the includes
pawn Code:
// 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 Code:
// 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 Code:
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 Code:
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
__________________
Why complications when keeping it simple is way better?

Do you miss the good old times at DM / TDM servers?
[Play4Fun] Las Venturas Bounty Hunters
-zriptarusk is offline   Reply With Quote
Old 03/04/2009, 03:50 PM   #2
Oxside
Huge Clucker
 
Join Date: Feb 2009
Posts: 461
Reputation: 0
Default Re: [Include] Simple Checkpoint Manager

REALLY NICE
But the post looks some gaotic!
Oxside is offline   Reply With Quote
Old 03/04/2009, 07:42 PM   #3
T RP [Tomorrows-RP.co.uk]
Little Clucker
 
Join Date: Apr 2009
Posts: 19
Reputation: 0
Default Re: [Include] Simple Checkpoint Manager

Quote:
Originally Posted by Oxside
REALLY NICE
But the post looks some gaotic!
Agreed.
T RP [Tomorrows-RP.co.uk] is offline   Reply With Quote
Old 03/04/2009, 09:25 PM   #4
-zriptarusk
Big Clucker
 
Join Date: Mar 2009
Location: Praia da Vitória, Azores
Posts: 72
Reputation: 5
Default Re: [Include] Simple Checkpoint Manager

Quote:
Originally Posted by Damien [T-RP
]
Quote:
Originally Posted by Oxside
REALLY NICE
But the post looks some gaotic!
Agreed.
Sorry lol.
It was my first release. I kinda didn't knew how to do it xD
__________________
Why complications when keeping it simple is way better?

Do you miss the good old times at DM / TDM servers?
[Play4Fun] Las Venturas Bounty Hunters
-zriptarusk is offline   Reply With Quote
Old 09/04/2009, 12:43 PM   #5
MazaHACKa
Little Clucker
 
Join Date: Feb 2009
Posts: 20
Reputation: 1
Default Re: [Include] Simple Checkpoint Manager

VERY VERY COOL!!!!!
THANKS!
MazaHACKa is offline   Reply With Quote
Old 14/06/2009, 10:02 AM   #6
cristab
High-roller
 
cristab's Avatar
 
Join Date: Oct 2008
Location: france / french 68
Posts: 1,931
Reputation: 25
Default Re: [Include] Simple Checkpoint Streamer

hello sorry for my bad english
then already superb include

I add a function when we exit the CP see below

pawn Code:
#include <a_samp>
#include <CheckpointManager>
#define CP_1 0
#define CP_2 1
#define CP_3 2
#define CP_4 3
#define CP_5 4

pawn Code:
public OnGameModeInit()
{
    CreateCheckpoint(GLOBAL_OWNER_ID, CP_1, 1958.3783,1343.1572,15.3746);
    CreateCheckpoint(GLOBAL_OWNER_ID, CP_2, 2031.7180,1366.5226,10.8203);
    CreateCheckpoint(GLOBAL_OWNER_ID, CP_3, 1988.9958,1422.4563,9.1094);
    CreateCheckpoint(GLOBAL_OWNER_ID, CP_4, 1957.9187,1447.3143,10.8203);
    CreateCheckpoint(GLOBAL_OWNER_ID, CP_5, 1910.4789,1496.8055,13.6717);
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    StartCheckpointSeeking();
    return 1;
}
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
  VerifyCheckpoint(playerid);
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
  VerifyCheckpointe(playerid);
    return 1;
}
pawn Code:
public OnCheckpointEnter(playerid, checkpointid){
    switch(checkpointid)
    {
     
      case CP_1:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_1 ");

      }
      case CP_2:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_2 ");

      }
      case CP_3:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_3 ");

      }
      case CP_4:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_4 ");

      }
      case CP_5:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "enter CP_5 ");

      }
    }
    return 1;
}
pawn Code:
public OnCheckpointEXIT(playerid, checkpointid){
    switch(checkpointid)
    {

      case CP_1:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_1 de test");

      }
      case CP_2:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_2 de test");

      }
      case CP_3:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_3 de test");

      }
      case CP_4:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_4 de test");

      }
      case CP_5:
      {
        SendClientMessage(playerid, 0xFFFFFFAA, "exit CP_5 de test");

      }
    }
    return 1;
}
__________________
en cas de soucis ma boite a mp est ouverte je repondrais volontier par contre j'ai un metier 3 enfants donc une famille qui passe avant qui sont plus jeune est moin con -_-


En cours de developpement
cristab is offline   Reply With Quote
Old 10/09/2009, 06:11 AM   #7
mr.b
Little Clucker
 
Join Date: Jun 2008
Posts: 41
Reputation: 0
Default Re: [Include] Simple Checkpoint Streamer

can you add checkpoint size?
mr.b is offline   Reply With Quote
Old 10/09/2009, 12:33 PM   #8
Blantas
Huge Clucker
 
Blantas's Avatar
 
Join Date: Feb 2009
Posts: 340
Reputation: 8
Default Re: [Include] Simple Checkpoint Streamer

Here you are:

http://blantas.paste.lt/paste/093419...902253927576bb


I added a size parameter:
Code:
CreateCheckpoint(ownerid, chpid, Float:posX, Float:posY, Float:posZ, Float:size);
Blantas is offline   Reply With Quote
Old 10/09/2009, 12:36 PM   #9
Calgon
Godfather
 
Join Date: Jan 2009
Posts: 6,218
Reputation: 840
Default Re: [Include] Simple Checkpoint Streamer

Interesting. Nice release. I'll probably use this.
__________________
(10:27:18 PM) dugi: hello is this the police?
(10:27:25 PM) dugi: Calgon is being mean
(10:27:31 PM) dugi: arrest him pls
Calgon is offline   Reply With Quote
Old 10/09/2009, 07:17 PM   #10
mr.b
Little Clucker
 
Join Date: Jun 2008
Posts: 41
Reputation: 0
Default Re: [Include] Simple Checkpoint Streamer

Quote:
Here you are:

http://blantas.paste.lt/paste/093419...902253927576bb


I added a size parameter:
Code:

CreateCheckpoint(ownerid, chpid, FloatosX, FloatosY, FloatosZ, Floatize);


Wink
thank you very much
mr.b is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[INCLUDE] ICPM - Invisible CheckPoint Manager - by Epsilon _[HuN]_Epsilon_ Filterscripts 19 10/06/2011 11:53 AM
[Include] [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! Yaheli_Faro Includes 46 20/04/2010 02:53 PM
Checkpoint streamer DarkPower Help Archive 3 10/02/2010 08:02 PM
Simple Define Include *Unfinished* Ritchie999 Help Archive 0 05/11/2009 08:26 PM


All times are GMT. The time now is 12:04 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.