[Include] [INC]Hidden CheckPoint System *Beta 0.2
#1

Why?
I have seen other hidden checkpoint systems(creds [HUN]Epsilon), and started writing one myself.
I decided to release this one as I added much more functionality.
I have not yet fully tested everything so it is still a Beta release.
If you notice any bugs please post.

Description:

You can create hidden checkpoints of different shapes: Square, Cube, Circle, Cylinder, and Sphere.
It detects when a player enters, exits, stops within, moves within a hidden checkpoint.

Functions:

Constructors:
Creates a hidden checkpoint of the type
returns hcpid, or -1 if it cannot create it
mstop: whether or not you want to detect repeated movements in the checkpoint
Code:
CreateHiddenCPSquare(Float:X1, Float:Y1, Float:X2, Float:Y2, bool:mstop = false)
     _________(X2,Y2)
    /  x>  /
(X1,Y1)/_________/y^   
CreateHiddenCPCube(Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2, bool:mstop = false)
       _________(X2,Y2,Z2)
      /|    /|
      /________ / |z^
     | |_ _ _ |_ |
     | / x>  | /
(X1,Y1,Z1)|/________|/y^
CreateHiddenCPCircle(Float:X, Float:Y, Float:R, bool:mstop = false)
      _____
     /    \
(X1,Y1)-|--->+®-|
     \ _____ /
CreateHiddenCPCylinder(Float:X, Float:Y, Float:Z, Float:R, Float:H, bool:mstop = false)
       _____
      /    \ _
      |  -®-| \
      |\_______/|  |
      | _____ |  >(H) z^
      |/  x> \|  |
(X1,Y1,Z1)-|--->+ y^ | _/
      \_______/
CreateHiddenCPSphere(Float:X, Float:Y, Float:Z, Float:R, bool:mstop = false)
       .-----.
      /  z^  \
(X1,Y1,Z1)-|---->*.® |
      \ x> y^`./
       `'-----'
Destructor:
Destroys a given checkpoint
no return
Code:
DestroyHiddenCheckPoint(hcpid)
Signal Movement:
Sets whether to detect for player repeated movement in a checkpoint
no return
Code:
SetHiddenCPMultiStop(hcpid, bool:mstop=true)
Is:
Common Is Commands
Code:
IsValidHiddenCP(hcpid)         returns 1 valid, 0 not valid
IsPlayerInHiddenCP(playerid, hcpid)  return 1 yes, 0 no
IsPlayerInAnyHiddenCP(playerid)    returns hdpic, or 0 if none
IsAnyPlayerInHiddenCP(hcpid)      returns 1 yes, 0 no
Ignore Functions:
Use these to not get callbacks for player entering a certain checkpoint
causese players to ignore hcp(s), default:-1 always ignore, 0 don't ignore, 1,2,3,+ ignore once,twice,thrice etc
no return
Code:
PlayerIngoreHiddenCP(playerid, hcpid, ignorerate=-1)
PlayerIgnoreAllHiddenCPS(playerid, ignorerate=-1)
PlayerIgnoreAllButHiddenCP(playerid, hcpid, ignorerate=-1)
AllPlayersIgnoreHiddenCP(hcpid, ignorerate=-1)
DisableHiddenCP(hcpid)
Get Centre:
returns 1 if it gets center, 0 if not
Code:
GetCentreofHiddenCP(hcpid, &Float:X, &Float:Y, &Float:Z)
How To Use:

CallBacks:
Code:
OnPlayerEnterHiddenCheckPoint(playerid, hcpid)     Player enters the given hidden checkpoint
OnPlayerExitHiddenCheckPoint(playerid, hcpid);     Player Leaves the given checkpoint
OnPlayerStopInHiddenCheckPoint(playerid, hcpid);    Player Stops in the given checkpoint
OnPlayerMoveInHiddenCheckPoint(playerid, hcpid);    Player Moves after being stopped in checkpoint, SetHiddenCPMultiStop(hcpid, bool:mstop=true) must be set to use this
Put either put a timer in:
pawn Code:
public OnFilterScriptInit()
{
    SetTimer("HiddenCPTimer", 500, 1);
}
or put a call in:
pawn Code:
public OnPlayerUpdate(playerid){
    HiddenCPTimer();
}
Download:
No Mirrors Please
Reply


Messages In This Thread
[INC]Hidden CheckPoint System *Beta 0.2 - by mansonh - 07.01.2010, 15:15
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by AiVAMAN - 07.01.2010, 16:04
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by mansonh - 07.01.2010, 16:22
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by armyoftwo - 07.01.2010, 18:25
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by mansonh - 07.01.2010, 18:27
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by [03]Garsino - 07.01.2010, 18:29
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by _[HuN]_Epsilon_ - 07.01.2010, 18:53
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by mansonh - 07.01.2010, 18:56
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by StreetGT - 07.01.2010, 19:19
Re: [INC]Hidden CheckPoint System *Beta 0.2 - by HydraX - 07.01.2010, 23:09

Forum Jump:


Users browsing this thread: 2 Guest(s)