GetPlayerCity ?
#1

Hello

How to get the city name of a player? (LS, SF, LV)

I always get zone names like Idlewood, Jefferson, Mulholland, etc...
Reply
#2

This will help you
http://forum.sa-mp.com/showthread.ph...ighlight=geoip
Reply
#3

I think he meant on Ingame cities. Not real life cities. xD
Reply
#4

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
I think he meant on Ingame cities. Not real life cities. xD
Yup^^
Reply
#5

lol i thought real :P
Reply
#6

xD
Well try making zones and then when someone uses command or for whatever reason you want this use zone detection(dont know function but it exsists)
Reply
#7

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
xD
Well try making zones and then when someone uses command or for whatever reason you want this use zone detection(dont know function but it exsists)
Well I have these zones, but it only shows the zone name (Ex: Mulholland), not city..
Reply
#8

Bump
Reply
#9

find all the area for each city(SF, LV, LS) then check if they are in the area with a command , you should know the rest... Julianorp
Reply
#10

pawn Код:
new Float:Cities[][CityInfo] = {
{ "Los Santos",                     44.60, -2892.90,  -242.90,  2997.00,  -768.00,   900.00},
{ "Las Venturas",                  869.40,   596.30,  -242.90,  2997.00,  2993.80,   900.00},
{ "San Fierro",                  -2997.40, -1115.50,  -242.90, -1213.90,  1659.60,   900.00}
pawn Код:
//Don't add this if you're already having something to get zones like idlewood or w/e. Just replace it.
enum CityInfo
{
    zone_name[30],
    Float:zone_minx,
    Float:zone_miny,
    Float:zone_minz,
    Float:zone_maxx,
    Float:zone_maxy,
    Float:zone_maxz
}
pawn Код:
stock GetPlayerCity(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    for(new i=0;i<sizeof(Zones);i++)
    {
        if(x > Zones[i][zone_minx] && y > Zones[i][zone_miny] && z > Zones[i][zone_minz] && x < Zones[i][zone_maxx] && y < Zones[i][zone_maxy] && z < Zones[i][zone_maxz])
        return i;
    }
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)