Checkpoints
#1

How to make checkpoint which not b marked on the radar and when im drive with car on it i will be teleported with car to lv.
Reply
#2

u have to use the SetPlayerRaceCheckpoint function.

https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint

in the OnPlayerEnterRaceCheckpoint callback u can put ur teleport command in.
Reply
#3

i dont understand anything, i need a script example
Reply
#4

About the marking, you can't make it invisible on map ( I think ), or just decrease the distance.
Also, use OnPlayerEnterCheckpoint.
Reply
#5

i think he wants to create a kind of race?
So he should use RaceCheckpoints?
But if u want to use playercp's itd look like this:

u have to store all cp id's in an enum first:

pawn Код:
//at the top of ur script
new CheckPoint[MAX_PLAYERS];

enum
{
cp1,
cp2,
cp3,
cp4,
//and so on...
}
Now you have to create the cp's:
pawn Код:
//first a stock function to create the cp with ur wanted id's
stock SetPlayerCheckpointForAll(ID, playerid, Float:x, Float:y, Float:z, Float:size) // Creating a new function that includes an ID parameter
{
    CheckPoint[playerid] = ID;
    SetPlayerCheckpoint(playerid, x, y, z, size);
}

//now create the cp:
SetCheckpointForAll(cp1,681.3374,-463.3429,22.5705,2.0);//cp1

//now under the callback OnPlayerEnterCheckpoint u can set the action that shall be executed as soon as a player enters a specific cp.

public OnPlayerEnterCheckpoint(playerid)
{

//checkpointselect
switch(CheckPoint[playerid])
{

case cp1:
{
//function for the first cp.
e.g. u can disable the first cp with DisableCheckpointForAll();
and create the second one

SetCheckpointForAll(cp2,681.3374,-463.3429,22.5705,2.0);//cp2

}
case cp2:
{
//function for cp 2
}
case cp3:
{
//for cp 3
}
hope that helps.
Reply
#6

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid,1515.3851318359,-1464.0179443359,9.5,5);
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    SetPlayerPos(playerid,3053.7912597656,3649.2023925781,3.6554095745087);
    return 1;
}
i have this but this one is fucked up, this one teleport me without car and this cp is showing on radar
Reply
#7

You want it to teleport your vehicle too?

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), 3053.791, 3649.202, 3.655);
    else SetPlayerPos(playerid, 3053.791, 3649.202, 3.655);
    return 1;
}
No need for so many numbers after decimal points.
Reply
#8

hmmm now seems ok but how can i turn off the checkpoint marker on radar?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)