SA-MP Forums Archive
[Include] [INC]Hidden CheckPoint System *Beta 0.2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC]Hidden CheckPoint System *Beta 0.2 (/showthread.php?tid=119282)



[INC]Hidden CheckPoint System *Beta 0.2 - mansonh - 07.01.2010

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:
http://pastebin.com/f78b5854b
No Mirrors Please


Re: [INC]Hidden CheckPoint System *Beta 0.2 - AiVAMAN - 07.01.2010

Very nice. keep it up.
Congratz for 1st release!


Re: [INC]Hidden CheckPoint System *Beta 0.2 - mansonh - 07.01.2010

Quote:
Originally Posted by AivaMan
Very nice. keep it up.
Congratz for 1st release!
Thanks.


Re: [INC]Hidden CheckPoint System *Beta 0.2 - armyoftwo - 07.01.2010

Woaw Nice... But i am not sure if i will need this
And for 1st release its excellent!


Re: [INC]Hidden CheckPoint System *Beta 0.2 - mansonh - 07.01.2010

Quote:
Originally Posted by Godfather:RP
Woaw Nice... But i am not sure if i will need this
And for 1st release its excellent!
Thanks.
It all depends, sometimes its nice to have areas where someone enters and something happens without having to have a big red thing.

Ex. I am currently using this for a garage system where you drive inside the garage, kinda like how the tuning garages work.


Re: [INC]Hidden CheckPoint System *Beta 0.2 - [03]Garsino - 07.01.2010

Good work! Will try this out


Re: [INC]Hidden CheckPoint System *Beta 0.2 - _[HuN]_Epsilon_ - 07.01.2010

Thanks for honesty

But why those forms useful?


Re: [INC]Hidden CheckPoint System *Beta 0.2 - mansonh - 07.01.2010

Quote:
Originally Posted by [03
Garsino ]
Good work! Will try this out


Quote:
Originally Posted by [HUN
Epsilon ]
Thanks for honesty
But why those forms useful?
np, i initially looked at yours to see how you did yours.

Do you mean the different shapes?
I use cube over sphere for large areas where i want an entire square room/area to be a part of it, not just a sphere in the center.
The other ones are useful for setting boundaries for places like anywhere in area69 no matter the Z.

Or do you mean why is it usefull to have onplayerstopin, and onplayermovein?

Those could be used for many things.
Player has to keep moving through a certain area, or a menu only comes up once a player stops moving in an area.
Someone enters a healing area, but they only heal while not moving.

For what I am using it for, i want my Garage to act exactly like the tuning garages, so a player can drive into the checkpoint, but it doesn't react until they stop moving. Then when they return nothing happens until they exit the garage again.


Re: [INC]Hidden CheckPoint System *Beta 0.2 - StreetGT - 07.01.2010

owoow xD nice


Re: [INC]Hidden CheckPoint System *Beta 0.2 - HydraX - 07.01.2010

Maybe someone give me a screenshot on how this looks like, I didn't understand it well