Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
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.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
Is there any way?? Saving all water positions will take like 1 month..
Posts: 3,351
Threads: 780
Joined: Jan 2010
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.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
This will work when player touches the water?
Or only works when player is using the swim animation?
Posts: 3,351
Threads: 780
Joined: Jan 2010
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.