[Include] [INC] Checkpoint Control (Streamer)
#1

CheckpointControl

Functions:

CreateCheckpoint(Float:X, Float:Y, Float:Z, Floatize, Float:distance, name[], bool:enable)
DestroyCheckpoint(cpid)
IsValidCheckpoint(cpid)

EnabledCheckpointForPlayer(playerid, cpid, bool:enable)*
EnabledCheckpointForAll(cpid, bool:enable)*
SetCheckpointPos(cpid, Float:X, Float:Y, Float:Z)*
SetCheckpointSize(cpid, Floatize)*
SetCheckpointSpawnDistance(cpid, Float:distance = 9999.9)*
SetCheckpointName(cpid, name[])*
GetCheckpointPos(cpid, &Float:X, &Float:Y, &Float:Z)
GetCheckpointSize(cpid)
GetCheckpointSpawnDistance(cpid)
GetCheckpointName(cpid)

IsCheckpointEnabledForPlayer(playerid, cpid)*
IsCheckpointEnabledForAll(cpid)*
IsPlayerInAnyCheckpoint(playerid)**
IsPlayerInCheckpoint(playerid, cpid)**
GetPlayerCheckpoint(playerid)

CPC_OnPlayerConnect(playerid)
CPC_OnPlayerEnterCheckpoint(playerid)
CPC_OnPlayerLeaveCheckpoint(playerid)

Callbacks:

OnPlayerEnterCheckpointEx(playerid, cpid, name[])
OnPlayerLeaveCheckpointEx(playerid, cpid, name[])


* cpid -1 = all
** playerid -1 = all



In some functions you can use "-1".
The "-1" means "every checkpoint/player".
Example:

pawn Code:
SetCheckpointName(0, "Test"); // Changes the name of checkpoint 0
SetCheckpointName(-1, "Test"); // Changes the name of every checkpoint


Please leave a comment if you download the include
/\
||
Pastebin
Reply
#2

Dude, i love it it's easy to use, and in scripting section was all about Checkpoints you saved ours life
Thanks a lot,
and great work.
Reply
#3

How do I set the cpID?
Reply
#4

Hey I tried to use it... Here's my resualts:

Code:
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\gamemodes\SAMPRolePlay.pwn(1881) : warning 235: public function lacks forward declaration (symbol "CPC_OnPlayerEnterCheckpoint")
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\gamemodes\SAMPRolePlay.pwn(1882) : error 021: symbol already defined: "CPC_OnPlayerEnterCheckpoint"
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\gamemodes\SAMPRolePlay.pwn(1883) : error 004: function "OnPlayerEnterCheckpointEx" is not implemented
For this code:

public CPC_OnPlayerEnterCheckpoint(playerid)
{
OnPlayerEnterCheckpointEx(playerid, 1, "cp_bank");
{
SendClientMessage(playerid, COLOR_GREEN, "***Welcome to the Bank***");
}
}
Reply
#5

pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
  CPC_OnPlayerEnterCheckpoint(playerid);
  return 1;
}

public OnPlayerEnterCheckpointEx(playerid, cpid, name[])
{
  // Do something
  if(cpid == cp_bank)
  {
    SendClientMessage(playerid, COLOR_GREEN, "***Welcome to the Bank***");
    return 1;
  }
  return 1;
}
Reply
#6

Code:
C:\Documents and Settings\Chris\Desktop\SAFR\Server\pawno\include\checkpoint.inc(433) : warning 219: local variable "x2" shadows a variable at a preceding level
C:\Documents and Settings\Chris\Desktop\SAFR\Server\pawno\include\checkpoint.inc(433) : warning 219: local variable "y2" shadows a variable at a preceding level
C:\Documents and Settings\Chris\Desktop\SAFR\Server\pawno\include\checkpoint.inc(433) : warning 219: local variable "z2" shadows a variable at a preceding level
eerrrmmm help please
Reply
#7

You've created x2, y2 and z2 in your script and in the include.
Reply
#8

i have checked they dont exist :S
Reply
#9

Then it was created in another include.
Reply
#10

Or in your GM/FS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)