07.01.2010, 15:15
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
Destructor:
Destroys a given checkpoint
no return
Signal Movement:
Sets whether to detect for player repeated movement in a checkpoint
no return
Is:
Common Is Commands
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
Get Centre:
returns 1 if it gets center, 0 if not
How To Use:
CallBacks:
Put either put a timer in:
or put a call in:
Download:
No Mirrors Please
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^`./ `'-----'
Destroys a given checkpoint
no return
Code:
DestroyHiddenCheckPoint(hcpid)
Sets whether to detect for player repeated movement in a checkpoint
no return
Code:
SetHiddenCPMultiStop(hcpid, bool:mstop=true)
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
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)
returns 1 if it gets center, 0 if not
Code:
GetCentreofHiddenCP(hcpid, &Float:X, &Float:Y, &Float:Z)
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
pawn Code:
public OnFilterScriptInit()
{
SetTimer("HiddenCPTimer", 500, 1);
}
pawn Code:
public OnPlayerUpdate(playerid){
HiddenCPTimer();
}
No Mirrors Please