Problem in Getting Zone Names
#1

pawn Код:
stock GetPlayer2DZone(playerid, zone[])
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(pInfo[playerid][InTheHouse])
    {
        format(zone,MAX_ZONE_NAME,"%s", HouseInfo[Hin[playerid]][HouseName]);
    }
    for(new a = 0; a < sizeof(zones); a++)
    {
        if(X > zones[a][zone_minx] && X < zones[a][zone_maxx] && Y > zones[a][zone_miny] && Y < zones[a][zone_maxy] && Z > zones[a][zone_minz] && Z < zones[a][zone_maxz])
        {
            return format(zone, MAX_ZONE_NAME, "%s",zones[a][zone_name]);
        }
    }
    return 0;
}
this function won't work
while this does it gets the wrong name only get fine name of interior
pawn Код:
forward DisplayZoneNames();
public DisplayZoneNames()
{
    for(new i; i < GetMaxPlayers(); i++)
    {

        if(IsPlayerConnected(i) && spawned[i] == 1)
        {
            new Float:X, Float:Y, Float:Z, string[256];

            GetPlayerPos(i, X, Y, Z);

            for(new a = 0; a < sizeof(zones); a++)
            {

                if(X > zones[a][zone_minx] && X < zones[a][zone_maxx] && Y > zones[a][zone_miny] && Y < zones[a][zone_maxy] && Z > zones[a][zone_minz] && Z < zones[a][zone_maxz])
                {
                    if(a != Zone[i])
                    {
                        format(string, sizeof(string), "%s",zones[a][zone_name]);
                        TextDrawSetString(ZoneName[i], string);
                        if(pInfo[i][InTheHouse])
                        {
                            format(string,sizeof(string),"%s", HouseInfo[Hin[i]][HouseName]);
                            TextDrawSetString(ZoneName[i], string);
                        }
                        if(sNiper[i] == 1)
                        {
                            TextDrawSetString(ZoneName[i],"Sniper Death Match");
                        }
                        Zone[i] = a;

                    }
                }
            }
        }
    }
}
this shows the name fine
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)