Label with textdraw help
#1

EDIT: Sloved!


When i go near the house is show once the label and then is disappear and then wont show up again


PHP код:
stock CreateLableText(playerid,lable[],text[])
{
    if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
    new 
string[128];
    if(
GetPVarInt(playerid"LableDraw") > 0)
    {
        
TextDrawSetString(Text:LableDraw[playerid],lable);
        
format(stringsizeof(string),"~n~~n~%s~n~~n~",text);
        return 
TextDrawSetString(Text:UsedDraw[playerid],string);
    }
    
PlayerPlaySound(playerid,10540.00.00.0);
    
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
    
TextDrawShowForPlayer(playerid,LableDraw[playerid]);
    
TextDrawSetString(Text:LableDraw[playerid],lable);
    
TextDrawDestroy(UsedDraw[playerid]);
    
UsedDraw[playerid] = TextDrawCreate(440.000000,173.000000," ");
    
TextDrawUseBox(UsedDraw[playerid],1);
    
TextDrawBoxColor(UsedDraw[playerid],0x00000066);
    
TextDrawTextSize(UsedDraw[playerid],636.000000,308.000000);
    
TextDrawAlignment(UsedDraw[playerid],0);
    
TextDrawBackgroundColor(UsedDraw[playerid],0x000000ff);
    
TextDrawFont(UsedDraw[playerid],2);
    
TextDrawLetterSize(UsedDraw[playerid],0.300000,1.000000);
    
TextDrawColor(UsedDraw[playerid],0xffffffff);
    
TextDrawSetOutline(UsedDraw[playerid],1);
    
TextDrawSetProportional(UsedDraw[playerid],1);
    
TextDrawSetShadow(UsedDraw[playerid],1);
    
TextDrawShowForPlayer(playerid,UsedDraw[playerid]);
    
format(stringsizeof(string),"~n~~n~%s~n~~n~",text);
    
TextDrawSetString(Text:UsedDraw[playerid],string);
    
KillTimer(HideBox[playerid]);
    
HideBox[playerid] = SetTimerEx("HideTextBox"1000false"i"playerid);
    return 
SetPVarInt(playerid"LableDraw"4);

PHP код:
}
forward HideTextBox(playerid);
public 
HideTextBox(playerid)
{
    
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
    
TextDrawHideForPlayer(playerid,UsedDraw[playerid]);
    return 
1;

PHP код:
forward OnPlayerPickUpDynamicPickup(playeridpickupid);
public 
OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    for(new 
0sizeof(HouseInfo); h++)
    {
        if(
IsPlayerInRangeOfPoint(playerid,2.0,HouseInfo[h][hExteriorX],HouseInfo[h][hExteriorY],HouseInfo[h][hExteriorZ]))
        {
            if(
GetPlayerVirtualWorld(playerid) == HouseInfo[h][hExtVW])
            {
                switch(
HouseInfo[h][hOwned])
                {
                    case 
0:
                    {
                        new 
string[258];
                        
format(stringsizeof(string), " ~r~Property For Sale!~n~ ~g~Value: ~w~$%d~n~ ~g~Level: ~w~%d~n~ ~g~ID: ~w~%d~n~~n~ Type ~g~/house buy."HouseInfo[h][hValue], HouseInfo[h][hLevel], HouseInfo[h][hSQLId]);
                        
CreateLableText(playerid,"Property",string);
                    }
                    case 
1:
                       {
                           new 
string[258];
                        new 
price[50];
                        if(
HouseInfo[h][hValue] <= 1price="Donated";
                        else 
format(price50"$%d"HouseInfo[h][hValue]);
                        switch(
HouseInfo[h][hRentable])
                        {
                            case 
0format(stringsizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Value: ~w~%s"HouseInfo[h][hOwned], price);
                            case 
1format(stringsizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Rent: ~w~$%d~n~~n~ Type ~g~/house rent ~w~to~n~ rent."HouseInfo[h][hOwned], HouseInfo[h][hRentFee]);
                        }
                        
CreateLableText(playerid,"Property",string); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)