SA-MP Forums Archive
[Include] MULTI COLERED FUNCTIONAL CP [by Razor] - 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] MULTI COLERED FUNCTIONAL CP [by Razor] (/showthread.php?tid=635343)



MULTI COLERED FUNCTIONAL CP [by Razor] - RazorGuigo - 05.06.2017

introduction:
This include it is simple but it is useful, the main purpose is to create several CPs that are visible at the same time! Besides having some extra colors as optional, and also several unique functions!

Features:
Quote:

+ Several CheckPoints are visible at the same time for the player
+ You can interact with more than one checkpoint at a time
+ You can move the checkpoint where you want it
+ Higher Performance and Precision than CheckPoint Normal
+ Stability, and visibility without glitchs (unlike DynCP)
+ Intuitive and easy-to-use syntax

CP types:
PHP Code:
CP_ARROW
CP_CIRCLE_BIG
CP_CIRCLE
CP_INVISIBLE 
Callbacks:
PHP Code:
OnPlayerEnterCheckpointEx(playeridcheckpoint[], CPID)
OnPlayerExitCheckpointEx(playeridcheckpoint[], CPID)
//extas:
OnPlayerTextInCP(playeridname[], CPIDtext[])
OnPlayerKeyStateChangeInCP(playeridname[], CPIDnewkeysoldkeys
Functions:
PHP Code:
CreatePlayerCheckPoint(playeridname[29] = ""CPType:type CP_CIRCLEcolor0x99FF0000Float:xFloat:yFloat:zworldid = -1interiorid = -1);
CreateCheckPoint(name[29] = ""CPType:type CP_CIRCLEcolor0x99FF0000Float:xFloat:yFloat:zworldid = -1interiorid = -1forplayer= -1);
IsPlayerInCheckpointEx(playeridname[]);
IsPlayerInAnyCheckpointEx(playerid);
IsPlayerInCP(playeridCPID);
DestroyCheckPointCPID);
//colors
SetCheckPointColor(CPIDcolor=0x99FF0000);
//movement
SetCPtoPosCPIDFloat:x=0.0Float:y=0.0Float:z=0.0);
MoveCPtoPosCPIDFloat:x=0.0Float:y=0.0Float:z=0.0Float:speed2.0);
//attachґs CP
AttachCPtoObjectCPIDobjectidFloat:x=0.0Float:y=0.0Float:z=0.0);
AttachCPtoPlayerCPIDplayeridFloat:x=0.0Float:y=0.0Float:z=0.0);
AttachCPtoVehicleCPIDvehicleidFloat:x=0.0Float:y=0.0Float:z=0.0);
AttachCPtoCPCPIDCPattachedFloat:x=0.0Float:y=0.0Float:z=0.0); 
Processing of CheckPoints:
PHP Code:
CPEnter:Pref(playerid)
{
  
SendClientMessage(playerid, -1"You entered the City Hall CP!");
  return 
1;
}
CPExit:Pref(playerid)
{
  
SendClientMessage(playerid, -1"You left the CP in the city hall!");
  return 
1;

[Briefly FS demonstrative of include]

Print Screens & Video:



https://www.youtube.com/watch?v=u1nG...ature=*********

Notes:Creditos:
Quote:
RazorGuigo -> Initial Release, Ideas, Extra Functionality, Colors, Features ...
Dayvison ->Internal Operation of the refurbished CPs!
OKStyle-> 5 new Color CheckPoints added in V1.3

Link for download:

Pastebin : https://pastebin.com/7YkVhPWD [V 1.5]
GitHub: https://github.com/RodrigoDornelles/MCF-CheckPoint [V 1.5]


CHANGELOG: - RazorGuigo - 05.06.2017

V 1.2:
Quote:
Add:
+SetCPpos( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0);
+MoveCP( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0, Float:speed= 2.0);
+mensagem de erro, caso vocк nгo esteja utilizando streamer
+CP for player (o checkpoint й criado apenas para o jogador descrito)

fix:
-quando vocк passa por debaixo de um CP, e depois vai embora, й chama "OnPlayerLeaveCP" foi concertado!
V 1.3:
Quote:
Merged:
*CreatePlayerCheckPoint(playerid, name[29] = "", CPType:type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1);
*CreateCheckPoint(name[29] = "", CPType:type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, forplayer= -1);
*OnPlayerEnterCheckpointEx(playerid, checkpoint[])
*OnPlayerExitCheckpointEx(playerid, checkpoint[])
*IsPlayerInCheckpointEx(playerid, name[])

removed:
-OnPlayerCPchange(playerid, CPID, toggle);
-SetCPInterior( CPID, interiorid);
-SetCPVirtualWord( CPID, worldid);
-SetCPpos( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0);
-MoveCP( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0, Float:speed= 2.0);

Added:
+5 novos modelos iguais ao originais (coloridos)
+processador de CheckPoint "Exemplo: CPEnter:Pref(playerid)"
+IsPlayerInAnyCheckpointEx(playerid);
+DestroyCheckPoint( CPID);

V 1.4:
Quote:
Edited:

*OnPlayerEnterCheckpointEx(playerid, checkpoint[], CPID)
*OnPlayerExitCheckpointEx(playerid, checkpoint[], CPID)

Added:
+OnPlayerTextInCP(playerid, name[], CPID, text[])
+OnPlayerKeyStateChangeInCP(playerid, name[], CPID, newkeys, oldkeys)

+SetCPtoPos( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0);
+MoveCPtoPos( CPID, Float:x=0.0, Float:y=0.0, Float:z=0.0, Float:speed= 2.0);

V 1.5:
Quote:
NOW HEXADECIMAL COLOURS!
Edited:

*CreatePlayerCheckPoint(playerid, name[29] = "", CPType:type = CP_CIRCLE, color= 0x99FF0000, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1);
*CreateCheckPoint(name[29] = "", CPType:type = CP_CIRCLE, color= 0x99FF0000, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, forplayer= -1);

Added:
+SetCheckPointColor(CPID, color=0x99FF0000);
+IsPlayerInCP(playerid, CPID);




Re: MULTI COLERED FUNCTIONAL CP [by Razor] - iKarim - 05.06.2017

I love the way "CPEnter" "CPExits" works, this gives me an idea, anyways good job on this script, i guess some people will have a use for it.


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - CheezIt - 05.06.2017

Unless you can make the objects a little less, hmm... utterly ugly... then 1 star. Maybe make them rotate? Because some servers use them and they are so damn ugly...


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - RazorGuigo - 05.06.2017

Quote:
Originally Posted by CheezIt
View Post
Unless you can make the objects a little less, hmm... utterly ugly... then 1 star. Maybe make them rotate? Because some servers use them and they are so damn ugly...
Making objects "rotate" is a waste of memory, moreover, it would bring a lot of problems with the detection, and would be bad, move the CP to another place!

Please not a star, if you do not know what you are complaining about!


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Spmn - 05.06.2017

Quote:
Originally Posted by RazorGuigo
View Post
Making objects "rotate" is a waste of memory, moreover, it would bring a lot of problems with the detection, and would be bad, move the CP to another place!

Please not a star, if you do not know what you are complaining about!
Waste of CPU cycles and bandwidth? Yes. Waste of memory? Hell no.

What possible problems could it bring? A rotating cylinder/cone is still a cylinder/cone, no matter of Z-angle.


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Nominal - 05.06.2017

Quote:
Originally Posted by RazorGuigo
View Post
Making objects "rotate" is a waste of memory, moreover, it would bring a lot of problems with the detection, and would be bad, move the CP to another place!

Please not a star, if you do not know what you are complaining about!
"Waste of memory" LMAO


I do not understand what you are saying... - RazorGuigo - 05.06.2017

Are you talking about rotating the z-axis in the form of motion? With speed, "fade"

Or set the angle of the checkpoint? And the object is fixed, without moving?


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - [G]am3r - 05.06.2017

Nice, I'll use it.


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Pottus - 05.06.2017

Just attach the object you want to rotate to an object that does rotate easy dirty way to do it.


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - coool - 06.06.2017

Nice


about rotation in z - RazorGuigo - 06.06.2017

Re to: Pottus
Quote:
Originally Posted by Pottus
Посмотреть сообщение
Just attach the object you want to rotate to an object that does rotate easy dirty way to do it.
Yes, I've done rotations on other things,
But I think putting this motion in include would be a creation of loopings, and flood of attachments not necessary
in view that objects have radial symmetry, and will be almost impersceptible (because of the imperfect objects having few has a minimal visualization of movement)


@OFF: Pottus was worth the pricey comment! You're awesome!
I love u!
--------------------------------------------------------------------------------------------------------------------------------

Re to: many people
I would not implement, this in the include, as for me it is irrelevant, but if it is the desire of many! Feel free to contribute! (But please, put it as optional if you do with pull request)


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - paulommu - 07.06.2017

Cool!


NEW UPDATE! - RazorGuigo - 08.06.2017

WOW!

V 1.5:
Quote:
NOW HEXADECIMAL COLOURS!
Edited:

*CreatePlayerCheckPoint(playerid, name[29] = "", CPType:type = CP_CIRCLE, color= 0x99FF0000, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1);
*CreateCheckPoint(name[29] = "", CPType:type = CP_CIRCLE, color= 0x99FF0000, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, forplayer= -1);

Added:
+SetCheckPointColor(CPID, color=0x99FF0000);
+IsPlayerInCP(playerid, CPID);




Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Immortal99 - 08.06.2017

Wow nice work


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Dayvison_ - 09.06.2017

Well. i liked this last update
good work


Re: MULTI COLERED FUNCTIONAL CP [by Razor] - Meck - 15.06.2017

como dб REP+ duas vezes ?

Otimo trabalho Razor, admiro muito seu trampo!