How to check in what city player is?
#7

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
Reply


Messages In This Thread
How to check in what city player is? - by Metharon - 25.07.2015, 20:15
Re: How to check in what city player is? - by TenTen - 25.07.2015, 20:17
Re: How to check in what city player is? - by iMFear - 25.07.2015, 20:18
Re: How to check in what city player is? - by SickAttack - 25.07.2015, 20:38
AW: How to check in what city player is? - by Mencent - 25.07.2015, 21:22
Re: How to check in what city player is? - by Igarashi - 26.07.2015, 19:08
Re: How to check in what city player is? - by TwinkiDaBoss - 26.07.2015, 19:24

Forum Jump:


Users browsing this thread: 3 Guest(s)