03.08.2013, 09:40
Код:
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);}}
I created this function couse there is many camhackers on A/D, TDM, BG gamemodes