[Include] GetDistanceBetweenPlayerAndCamera
#1

Код:
stock Float:GetDistanceBetweenPlayerAndCamera(playerid){if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING){ new Float:pP[3],Float:tP[3]; if(!GetPlayerPos(playerid,pP[0],pP[1],pP[2]) || !GetPlayerCameraPos(playerid,tP[0],tP[1],tP[2])) return Float_NaN; pP[0] -= tP[0], pP[1] -= tP[1],	pP[2] -= tP[2];	return floatsqroot(floatpower(pP[0],2.0) + floatpower(pP[1],2.0) + floatpower(pP[2],2.0));}else{ return floatsqroot(0);}}
When player is spawned this code can be used to detecting camhack / freecam.cs / specplayer.cs
I created this function couse there is many camhackers on A/D, TDM, BG gamemodes
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=38965
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)