SA-MP Forums Archive
Check points size - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Check points size (/showthread.php?tid=618757)



Check points size - MerryDeer - 09.10.2016

Hi,

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


Re: Check points size - azzerking - 09.10.2016

Could you try to explain your point again? I don't understand what your point is?


Re: Check points size - MerryDeer - 09.10.2016

I have

http://******************/post/Anti_...include-19846/

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


Re: Check points size - azzerking - 09.10.2016

Код:
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


Re: Check points size - MerryDeer - 09.10.2016

I use checkpoint size where is that distance 10.0 and 20.0


Re: Check points size - azzerking - 09.10.2016

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.


Re: Check points size - MerryDeer - 10.10.2016

I don't understand it's bad i use radius checkpoint size or no?