GetPlayerCity ?
#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


Messages In This Thread
GetPlayerCity ? - by Julian12345 - 13.07.2011, 20:50
Re: GetPlayerCity ? - by Ironboy - 13.07.2011, 20:59
Re: GetPlayerCity ? - by [MG]Dimi - 13.07.2011, 21:04
AW: Re: GetPlayerCity ? - by Julian12345 - 13.07.2011, 21:06
Re: GetPlayerCity ? - by Ironboy - 13.07.2011, 21:10
Re: GetPlayerCity ? - by [MG]Dimi - 13.07.2011, 21:17
AW: Re: GetPlayerCity ? - by Julian12345 - 13.07.2011, 21:23
AW: GetPlayerCity ? - by Julian12345 - 14.07.2011, 15:41
Re: GetPlayerCity ? - by Jay. - 14.07.2011, 15:46
Re: GetPlayerCity ? - by Adil - 14.07.2011, 15:56

Forum Jump:


Users browsing this thread: 1 Guest(s)