SA-MP Forums Archive
How to check in what city player is? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to check in what city player is? (/showthread.php?tid=583083)



How to check in what city player is? - Metharon - 25.07.2015

I want to check if a player is in los santos , or las venturs , or san fierro ,or small city.

but how


Re: How to check in what city player is? - TenTen - 25.07.2015

/spec spectating command


Re: How to check in what city player is? - iMFear - 25.07.2015

Use this, can be useful: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

example:

PHP код:
    if(IsPlayerInRangeOfPoint(playerid200.0XYZ)) //get the cordinate of center of LV(or any city), and put here. 200.0 is the "example range", but increase this number depending of the city.
    
{
        
SendClientMessage(playerid,0xFFFFFFFF,"You are near of Las Venturas!"); //Functions, SendClientMessage is a example.
    




Re: How to check in what city player is? - SickAttack - 25.07.2015

Didn't you make a similar thread? I replied on one.


AW: How to check in what city player is? - Mencent - 25.07.2015

Hello!

Look at this filterscript:
https://sampforum.blast.hk/showthread.php?tid=161741


- Mencent


Re: How to check in what city player is? - Igarashi - 26.07.2015

https://sampforum.blast.hk/showthread.php?pid=3518043#pid3518043

Here you have the script


Re: How to check in what city player is? - TwinkiDaBoss - 26.07.2015

Download streamer and here you go

pawn Код:
#include <a_samp>
#include <streamer>

#define MAX_ZONES 3

new zones[MAX_ZONES];
new Float:zones_points_0[] = {
    31.0, -568.0, 2991.0, 1692.0
};
new Float:zones_points_1[] = {
    -2997.0, 1540.0, -1225.0, 3760.0
};
new Float:zones_points_2[] = {
    859.0, 3036.0, 2995.0, 5588.0
};
new zones_text[MAX_ZONES][64] = {
    "Los Santos",
    "San Fierro",
    "las Venturas"
};


public OnFilterScriptInit()
{

    zones[0] = CreateDynamicRectangle(zones_points_0[0], zones_points_0[1], zones_points_0[2], zones_points_0[3]);
    zones[1] = CreateDynamicRectangle(zones_points_1[0], zones_points_1[1], zones_points_1[2], zones_points_1[3]);
    zones[2] = CreateDynamicRectangle(zones_points_2[0], zones_points_2[1], zones_points_2[2], zones_points_2[3]);

    return 1;
}

public OnFilterScriptExit() {
    return 1;
}

public OnPlayerEnterDynamicArea(playerid, areaid) {
    for (new zone=0; zone<MAX_ZONES; zone++) {
        if (areaid==zones[zone]) {
            new msg[90];
            format(msg, 90, "Welcome to %s", zones_text[zone]);
            SendClientMessage(playerid, 0xFFFFFFFF, msg);
        }
    }
    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid) {
    for (new zone=0; zone<MAX_ZONES; zone++) {
        if (areaid==zones[zone]) {
            new msg[90];
            format(msg, 90, "Goodbye from %s", zones_text[zone]);
            SendClientMessage(playerid, 0xFFFFFFFF, msg);
        }
    }
    return 1;
}
This will work for players that area only in Cities itself. If you want more contact me.

Credits to Grimrandomer for creating SAMP zone editor