How to check in what city player is?
#1

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

but how
Reply
#2

/spec spectating command
Reply
#3

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.
    

Reply
#4

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

Hello!

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


- Mencent
Reply
#6

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

Here you have the script
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)