05.02.2010, 03:46
[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)
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>
Add
pawn Code:
StartUp();
Add
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
CPEnterCheck(playerid);
return 1;
}
pawn Code:
public OnPlayerLeaveCheckpoint(playerid)
{
CPLeaveCheck(playerid);
return 1;
}
pawn Code:
public OnPlayerEnterStreamedCheckpoint(playerid, cpid)
{
return 1;
}
public OnPlayerExitStreamedCheckpoint(playerid, cpid)
{
return 1;
}
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!