12.05.2013, 09:12
Color CP
[Now create a checkpoint with different colors]
Introduction[Now create a checkpoint with different colors]
This project has been started since May 10, 2013. I was going to release it yesterday but having problems. So i delayed it and release the JakCP.inc instead.
You can create 100 color cp (MAX_CCP) with 5 different colors. The checkpoint is not really actually a checkpoint. It is object object 1317. It previous SA-MP version it is impossible to change it's color. The default color of object 1317 is grey. With the help of SetObjectMaterialEx (Meta's include gives ability to use RGB colors). We can now change 1317's object color.
The scripting is little bit messed up (for my opinion) however it still works.
there are current 3 function for a while. But you can add one if you want.
Abilities
Like my JakCP.inc. It can detect if there is any color CP streamed in/streamed out.
Like checkpoint. It can detect if player enter the color CP.
By using IsPlayerInRangeOfPoint. we can call the OnPlayerEnterColorCP/OnPlayerExitColorCP callback!
Callback
OnPlayerEnterColorCP
parameters: playerid, checkpointid (checkpointid - the checkpointid that player has entered!)
OnPlayerExitColorCP
parameters: playerid, checkpointid (checkpointid - the checkpointid that player has exited!)
OnPlayerColorCPStreamIn
parameters: playerid, checkpointid (checkpointid - the checkpointid that has been streamed in)
OnPlayerColorCPStreamOut
parameters: playerid, checkpointid (checkpointid - the checkpointid that has been streamed out)
Function
GetTotalAllColorCP();
- Counts all color cp.
Returns how many color cp has been created.
-----------
CreatePlayerColorCP(marker = 1, interior = -1, world = -1, Float, Float:y, Float:z, color = 0, Float:distance = 100.0)
- marker automatically set to 1. if it is 0, the checkpoint marker is not shown in the radar.
- interior automatically set to -1, - world automatically set to -1
- x = x coordinates, - y = y coordinates, - z = z coordinates,
- color automatically set to 0. Can handle 0 up to 4 colors.
Code:
0 (red) 1 (orange) 2 (yellow) 3 (green) 4 (blue)
returns the color checkpointid
-----------
IsValidColorCP(checkpointid)
parameter: checkpointid
checkpointid - the checkpointid to check if it exist or not
returns true if it exist. returns false if it doesn't exist!
Limits:
Can handle: 100 color cp.
Colors that you can choose: Red, Green, Blue, Orange, Yellow
Credits: OKStyle (Idea), Vince (for the code except the colors), _Jake_ (creating include)
Download:
http://www.solidfiles.com/d/8e514a716b/