25.02.2011, 15:51
Checkpoints
25.02.2011, 15:56
u have to use the SetPlayerRaceCheckpoint function.
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint
in the OnPlayerEnterRaceCheckpoint callback u can put ur teleport command in.
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint
in the OnPlayerEnterRaceCheckpoint callback u can put ur teleport command in.
25.02.2011, 16:04
i dont understand anything, i need a script example
25.02.2011, 19:33
About the marking, you can't make it invisible on map ( I think ), or just decrease the distance.
Also, use OnPlayerEnterCheckpoint.
Also, use OnPlayerEnterCheckpoint.
25.02.2011, 20:28
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:
Now you have to create the cp's:
hope that helps.
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...
}
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
}
![Tongue](images/smilies/razz.gif)
26.02.2011, 14:45
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;
}
26.02.2011, 15:28
You want it to teleport your vehicle too?
No need for so many numbers after decimal points.
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;
}
26.02.2011, 17:13
hmmm now seems ok but how can i turn off the checkpoint marker on radar?
« Next Oldest | Next Newest »
Users browsing this thread: 5 Guest(s)