PDA

View Full Version : Check points size

MerryDeer
09/10/2016, 04:24 PM
Hi,

Is there left that bug in sa-mp that if you create new check point size is older check point?

azzerking
09/10/2016, 05:30 PM
Could you try to explain your point again? I don't understand what your point is?

MerryDeer
09/10/2016, 07:53 PM
I have

http://******************/post/Anti_Checkpoint_Warp-Garnet-other_include-19846/

But sometimes, players not using cheats get kick... like when suddenly exit car and take checkpoint.

azzerking
09/10/2016, 08:03 PM
public OnPlayerEnterCheckpoint( playerid )
{
if( IsPlayerInAnyVehicle( playerid ) )
{
new
Float: Vx,
Float: Vy,
Float: Vz
;

GetVehiclePos( GetPlayerVehicleID( playerid ), Vx, Vy, Vz );
if( GetDistance( Vx, Vy, Vz, TampanDanBerani[playerid][0], TampanDanBerani[playerid][1], TampanDanBerani[playerid][2] ) > 20 ) return Kick( playerid );
}
else
{
if( !IsPlayerInRangeOfPoint( playerid, 10.0, TampanDanBerani[playerid][0], TampanDanBerani[playerid][1], TampanDanBerani[playerid][2] ) ) return Kick( playerid );
}

return 1;
}

I have made bold the areas you should increase if you wish to detect players outside the checkpoint area

MerryDeer
09/10/2016, 08:05 PM
I use checkpoint size where is that distance 10.0 and 20.0

azzerking
09/10/2016, 08:10 PM
Okay this is how it works.

TampanDanBerani[playerid][0] // This is the X coordinate.
TampanDanBerani[playerid][1] // This is the Y coordinate.
TampanDanBerani[playerid][2] // This is the Z coordinate.

These values add up to a single position in the sa-mp world. Now when using radius ( 10.0 and 20.0 are the radius ) it checks if the player is within a certain distance of the x,y and z coordinate.

So if your coordinate are equal to your checkpoint, then the radius is how far from the checkpoint middle point you are. think of it like drawing a circle with the middle of the circle being the X,Y point is.

MerryDeer
10/10/2016, 08:48 AM
I don't understand it's bad i use radius checkpoint size or no?