[Include] Color CP [Now create a checkpoint with different colors!]
#1

Color CP
[Now create a checkpoint with different colors]
Introduction

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)
- distance = range where can color checkpoint can be see. Automatically disappears when out of the range.

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/
Reply
#2

Awesome great work! o:
Reply
#3

thanks
Reply
#4

Good, but why don't you show us a picture with a colored checkpoint?
Reply
#5

Nice, I'd advise adding more colors. Because with SetObjectMaterialEx, endless possibilities are there!
Reply
#6

Quote:
Originally Posted by DiGiTaL_AnGeL
View Post
Good, but why don't you show us a picture with a colored checkpoint?
Nah no need to.

click this link
http://forum.sa-mp.com/showthread.ph...hlight=Colored

to see the screenshot.
Reply
#7

OMG!! its Super Duper COOL
Reply
#8

I knew what this would be as soon as I saw the title. It's not as good as it sounds though.
Reply
#9

Nice and good to see you finally fixed those mistakes.
Reply
#10

Good work.
Reply
#11

You should make it possible to also remove checkpoints I would also sacrifice two callbacks for a much improved update system.

pawn Код:
forward OnPlayerColorCPStreamIn(playerid, checkpointid);
forward OnPlayerColorCPStreamOut(playerid, checkpointid);
These are pretty useless overall anyways, instead create dynamic checkpoints with a size of 0.0 that way the marker will show up on radar to indicate checkpoint proximity then use Dynamic areas to determine when a player enters/exits a checkpoint. The main improvement is eliminating the need for looping to check when a player is near or in a checkpoint in fact the only loop you would have is checking if the dynamic area entered is part of the colored checkpoint system.

Overall the current form of this include is not very useful particularly in a public server the amount of looping is excessive on top of that you got some pvars which are slow and have no business being in loops.

3/10 on this include it could really use a world of improvement.
Reply
#12

well i dont mind what others say the main thing is some here just cracked the limits of cp from 1 and if you use these correctly you could really make things rocking
and its a nice release sir
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)