[Include] [INC]EasyCPS V1.0
#1

[INC]EasyCPS
Information: This CP streamer was made by me for a server but they no longer need it. So it's time to release it, this script took me a day to make and test so enjoy .


Functions:
pawn Code:
CreateCheckpoint(playerid, Float:cpX, Float:cpY, Float:cpZ, Float:cpSize, Float:viewdist)
Playerid - The playerid that the CP should show for, -1 for all.
cpX - The X Position of the CP
cpY - The Y Position of the CP
cpZ - The Z Position of the CP
cpSize - The CP size
viewdist - The view distance between you and the CP, this is optional (Default is 35).

Other functions:

SetCheckPointWorld(cPiD, world) - Sets the Checkpoints virtual world
SetCheckPointInterior(cPiD, Int) - Sets the Checkpoints Interior
DisableCP(cPiD) - Disables a CP
EnableCP(cPiD) - Enables a disabled CP
ShowCPForPlayer(cPiD, playerid) - Shows a CP for a certain player
HideCPForPlayer(cPiD, playerid) - Hides a CP for a certain player
GetCPClosestToPlayer(playerid) - Returns the CP closest to the player
GetPlayerCheckpoint(playerid) - Returns the players checkpoint, if he is in none then it will return -1
EnableCPSForPlayer(playerid) - Enables the CP streamer for a player
DisableCPSForPlayer(playerid) - Disables the CP streamer for a player
IsPlayerInCP(playerid) - Checks if the player is in a CP
GotoCP(playerid, CpId) - Sets the player Position at the CP
ReturnCPLocation(CpId, &Float:X, &Float:Y, &Float:Z) - Returns the CP location
GetCPSize(CpId) - Returns the CP size
GetCPViewDistance(CpId) - Returns the CP view distance
IsCPActive(CpId) - Returns if the CP is active or not
SetCPLocation(CpId, Float:X, Float:Y, Float:Z) - Sets the CP location
IsValidCP(CpId) - Checks if the CP is valid
SetCPSize(CpId, Float:Sizee) - Sets the CP size
SetCPViewDistance(CpId, Floatista) - Sets the CP view distance


How to use:
Add
pawn Code:
#include <EasyCPS>
To the top of your script.

Add
pawn Code:
StartUp();
Under OnGameModeInit() or Under OnFilterScriptInit().

Add
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
    CPEnterCheck(playerid);
    return 1;
}
And
pawn Code:
public OnPlayerLeaveCheckpoint(playerid)
{
    CPLeaveCheck(playerid);
    return 1;
}
pawn Code:
public OnPlayerEnterStreamedCheckpoint(playerid, cpid)
{
  return 1;
}

public OnPlayerExitStreamedCheckpoint(playerid, cpid)
{
  return 1;
}
Now you are ready to add CPS =].

pawn Code:
new MyCP = CreateCheckpoint(-1, 1000, 1000, 1000, 5);
pawn Code:
public OnPlayerEnterStreamedCheckpoint(playerid, cpid)
{
  if(cpid == MyCP)
  {
    GameTextForPlayer(playerid, "~g~You found the hidden checkpoint and have found $100", 2000, 3);
    GivePlayerMoney(playerid, 100);
  }
  return 1;
}

Download: http://www.datafilehost.com/download-25b84108.html

Post bugs/Errors!
Reply
#2

Nice one !
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
Nice one !
Thanks
Reply
#4

Very useful thank you
Reply
#5

Quote:
Originally Posted by RenisiL
Very useful thank you
thx
Reply
#6

Wow nice script
Reply
#7

Quote:
Originally Posted by <Krys>
Wow nice script
Thank you.
Reply
#8

Quote:
Originally Posted by RenisiL
Very useful thank you
Reply
#9

Thanks.
Reply
#10

It is not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)