|
Код:
Inc's #include <a_samp> #include <core> #include <dns> #include <streamer> #include <a_mysql> #include <foreach> #include <sscanf2> #include <progress> #include <mapandreas> Код:
Plugins whirlpool streamer sscanf nativechecker mysql filefunctions dns crashdetect MapAndreas |
#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;
}
|
Код:
#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;
}
|
|
You probably forgot to get angle of player. And calling floatsin and floatcos with NULL. Try to use https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
|
#define MAP_ANDREAS_MODE_NONE 0 #define MAP_ANDREAS_MODE_MINIMAL 1 // for future use #define MAP_ANDREAS_MODE_FULL 2