IsPlayerNearWater not working as it should
#6

Quote:
Originally Posted by DarK_FeneR
Посмотреть сообщение
Try with MapAndreas plugin:

pawn Код:
stock IsWaterInFrontOfPlayer(playerid, Float: range = 1.0)
{
    new Float:fPX, Float:fPY, Float:fPZ,
        Float:fVX, Float:fVY, Float:fVZ,
        Float:object_x, Float:object_y, Float:object_z;

    GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
    GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);

    object_x = fPX + floatmul(fVX, range);
    object_y = fPY + floatmul(fVY, range);

    MapAndreas_FindZ_For2DCoord(object_x, object_y, object_z);

    if(object_z <= 0.0) return true;
    return false;
}
Directly from my server code Lost Springs Roleplay (ITA)
I put that stock to my server, but i can still fish everywhere, i got this in my fish command

pawn Код:
if((IsWaterInFrontOfPlayer(playerid)) || IsPlayerInWater(playerid))
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)