SA-MP Forums Detection of is player near any source of water
 New Account Members List Search Today's Posts Mark Forums Read

 04/05/2015, 08:33 AM #1 Beckett High-roller     Join Date: Feb 2012 Location: www.finalnights-rp.com Posts: 1,794 Reputation: 104 Detection of is player near any source of water I've been searching through the forums for a quite while for a function that checks if player is nearby any source of water, NOT SWIMMING. I hope I explained it well, thanks in advance.
 04/05/2015, 09:14 AM #2 Gammix High-roller     Join Date: Jan 2015 Location: Canada Posts: 1,773 Reputation: 858 Re: Detection of is player near any source of water Using mapandreas, this will work: pawn Code: `#include ` http://forum.sa-mp.com/showthread.php?t=275492 Use it as a stock if in include or declare it as a function in the script. pawn Code: `stock IsPlayerNearWater(playerid){    static Float:pos[3];    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);//read positions    static Float:check_pos[3];    static Float:angle;    #define THRESHOLD   4.0    #define RADIUS      5.0    if(pos[2] > 0.0 && pos[2] < THRESHOLD)    {        for(new i = 0; i < 4; i++)        {            check_pos[0] = pos[0] + (RADIUS * floatsin(-angle, degrees));            check_pos[1] = pos[1] + (RADIUS * floatcos(-angle, degrees));            angle += 90.0;            MapAndreas_FindZ_For2DCoord(check_pos[0], check_pos[1], check_pos[2]);            if(check_pos[2] == 0.0) return true;        }    }    return false;}` __________________ Follow me on Github: Donate on Paypal:
 04/05/2015, 10:56 AM #3 Beckett High-roller     Join Date: Feb 2012 Location: www.finalnights-rp.com Posts: 1,794 Reputation: 104 Re: Detection of is player near any source of water I'll try this when I have the time and reply to you back, thanks for dedicating your time into this.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post RajatPawar Scripting Help 3 02/11/2013 04:49 PM SDraw Includes 4 29/03/2013 06:24 PM The_Gangstas Help Archive 3 21/12/2010 11:42 PM arnutisz Help Archive 5 04/02/2010 11:56 AM

All times are GMT. The time now is 08:39 AM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top