Checking if player is near in the water
#1

I'm creating a fishing system for my upcoming Roleplaying server.

And i need to check if player is near in any water area.
Not only in Fishing places..

I searched and check the [FS] Fishing System but they are only work when the player is in fishing places.
Reply
#2

hmmm then you must get all x y z pos near water then use
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) SendClientMessage(playerid, -1,"In 1 hour the shark will eat you");
Reply
#3

Is there any way?? Saving all water positions will take like 1 month..
Reply
#4

Hey pig try this:

pawn Код:
stock IsPlayerInWater(playerid)
{
    new lib[16],anim[32];
    GetAnimationName(GetPlayerAnimationIndex(playerid), lib, sizeof(lib), anim, sizeof(anim));
    if(!strcmp(lib, "SWIM", true) && !isnull(lib)) return 1;
    return 0;
}
You don't have to get all water coordinates, just use the swimming animation.
Reply
#5

This will work when player touches the water?
Or only works when player is using the swim animation?
Reply
#6

It will work when the player starts swimming (using the SWIM animation), so yes, when a player touches the water.

You can use
pawn Код:
if(IsPlayerInRangeOfPoint
by lowering by 10 degrees combined with the script i provided you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)