15.01.2016, 12:45
Quote:
Код:
#include <mapandreas> OnGameModeInit MapAndreas_Init(MAP_ANDREAS_MODE_FULL); Код:
#define MAX_Z_FISH_THRESHOLD 4.0 #define WATER_CHECK_RADIUS 1.0 IsPlayerNearWater(playerid) { new Float:x, Float:y, Float:z, Float:checkx, Float:checky, Float:checkz, Float:angle; GetPlayerPos(playerid, x, y, z); if(z > 0.0 && z < MAX_Z_FISH_THRESHOLD) { for(new i = 0; i < 4; i++) { checkx = x + (WATER_CHECK_RADIUS * floatsin(-angle, degrees)); checky = y + (WATER_CHECK_RADIUS * floatcos(-angle, degrees)); angle += 90.0; MapAndreas_FindZ_For2DCoord(checkx, checky, checkz); if(checkz == 0.0) return 1; } } return 0; } |