Problem in Getting Zone Names
#9

pawn Код:
stock GetPlayer2DZone(playerid, zone[])
{
    new
        Float: X,
        Float: Y,
        Float: Z;
   
    GetPlayerPos(playerid, X, Y, Z);
    if (pInfo[playerid][InTheHouse] && 0 <= Hin[playerid] < sizeof (HouseInfo))
    {
        return strcat((zone[0] = '\0', zone), HouseInfo[Hin[playerid]][HouseName], MAX_ZONE_NAME);
    }
    else
    {
        for (new a; a != sizeof (zones); ++a)
        {
            if (zones[a][zone_minx] < X < zones[a][zone_maxx] && zones[a][zone_miny] < Y < zones[a][zone_maxy] && zones[a][zone_minz] < Z < zones[a][zone_maxz])
            {
                return strcat((zone[0] = '\0', zone), zones[a][zone_name], MAX_ZONE_NAME);
            }
        }
    }
    return 0;
}
Note that if you're in a house and Hin[playerid] doesn't hold the correct value, it will return 0 and it won't show the name.
Reply


Messages In This Thread
Problem in Getting Zone Names - by AroseKhanNiazi - 18.07.2014, 11:12
Re: Problem in Getting Zone Names - by BroZeus - 18.07.2014, 11:18
Re: Problem in Getting Zone Names - by AroseKhanNiazi - 18.07.2014, 11:28
Re: Problem in Getting Zone Names - by BroZeus - 18.07.2014, 11:30
Re: Problem in Getting Zone Names - by AroseKhanNiazi - 18.07.2014, 11:34
Re: Problem in Getting Zone Names - by Konstantinos - 18.07.2014, 11:39
Re: Problem in Getting Zone Names - by BroZeus - 18.07.2014, 11:42
Re: Problem in Getting Zone Names - by AroseKhanNiazi - 18.07.2014, 11:47
Re: Problem in Getting Zone Names - by Konstantinos - 18.07.2014, 12:01
Re: Problem in Getting Zone Names - by AroseKhanNiazi - 18.07.2014, 12:13

Forum Jump:


Users browsing this thread: 1 Guest(s)