Map name with textdraw
#1

Have some problem try to make textdraw that show location, but the problem is for ex if i am at ganton says i am Idlewood and if i stand still its just showing some random names. i hope u guys can help me out.

PHP код:
    Mapdraw TextDrawCreate(48.000000326.000000"");
    
TextDrawBackgroundColor(Mapdraw255);
    
TextDrawFont(Mapdraw1);
    
TextDrawLetterSize(Mapdraw0.5000001.200000);
    
TextDrawColor(Mapdraw, -1);
    
TextDrawSetOutline(Mapdraw0);
    
TextDrawSetProportional(Mapdraw1);
    
TextDrawSetShadow(Mapdraw1);
    
TextDrawSetSelectable(Mapdraw0);
stock GetPlayerArea(playerid)
{
    new 
str[128];
    
format(str,sizeof(str),"%s",Zones[GetPlayerZone(playerid)][zone_name]);
    if(
GetPlayerInterior(playerid) > 0)
    {
        if(
GetPVarInt(playerid"GarageEnter") != 1000 && GetPlayerInterior(playerid) == GarageInfo[GetPVarInt(playerid"GarageEnter")][gInterior])
        {
            
format(str,sizeof(str),"%s"GarageInfo[GetPVarInt(playerid"GarageEnter")][gName]);
        }
        else if(
GetPVarInt(playerid"HouseEnter") != 1000 && GetPlayerInterior(playerid) == HouseInfo[GetPVarInt(playerid"HouseEnter")][hInterior])
        {
            
format(str,sizeof(str),"%s"HouseInfo[GetPVarInt(playerid"HouseEnter")][hName]);
        }
        else if(
GetPVarInt(playerid"IntEnter") != 1000 && GetPlayerInterior(playerid) == IntInfo[GetPVarInt(playerid"IntEnter")][iInt])
        {
            
format(str,sizeof(str),"%s"IntInfo[GetPVarInt(playerid"IntEnter")][iName]);
        }
        else if(
GetPVarInt(playerid"BizzEnter") != 1000 && GetPlayerInterior(playerid) == BizzInfo[GetPVarInt(playerid"BizzEnter")][bInterior])
        {
            
format(str,sizeof(str),"%s"BizzInfo[GetPVarInt(playerid"BizzEnter")][bName]);
        }
        else 
str="Interior";
    }
    return 
str;
}
stock GetPlayerZone(playerid)
{
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(playerid,x,y,z);
    for(new 
i=0;i<sizeof(Zones);i++)
    {
        if(
Zones[i][zone_minx] && Zones[i][zone_miny] && Zones[i][zone_minz] && Zones[i][zone_maxx] && Zones[i][zone_maxy] && Zones[i][zone_maxz])
        return 
i;
    }
    return 
false;
}
//============================================//
stock LoadAreaPl(playeridtypenum)
{
    new 
string[128];
    switch(
type)
    {
        case 
0format(string128"%s"GetPlayerArea(playerid));
        case 
1format(string128"%s"HouseInfo[num][hName]);
        case 
2format(string128"%s"IntInfo[num][iName]);
        case 
3format(string128"%s"BizzInfo[num][bName]);
        case 
4format(string128"%s"GarageInfo[num][gName]);
        case 
5string="Interior";
    }
    if(
GetPVarInt(playerid,"HudHide") == 0TextDrawSetString(Text:Mapdrawstring);
    
//if(GetPVarInt(playerid,"HudHide") == 0) GameTextForPlayer(playerid, string, 2000, 1);
    
return true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)