Textdraw Problem - Paying 5$ for a fix.
#1

Well - As you see , I am not really experienced with using text-draws.. But ya, I wanted to try my luck.. However - This system works that once you enter a certain pickup - Some TD's appear with a text in it - Anyway - It disappear if you didn't set ANY text inside the board - But when you use the CMD and set a text to the TD - It never appear :/

- Note : I am paying the 5 bucks if you fix the 2 problems. [paypal]


PHP код:
        for(new 0sizeof(InfoBoardInfo); i++)
    {
        if(
pickupid == InfoBoardInfo[i][InfoBoardPickupID])
        {
            if(
IsPlayerInRangeOfPoint(playerid5.0InfoBoardInfo[i][InfoBoardX], InfoBoardInfo[i][InfoBoardY], InfoBoardInfo[i][InfoBoardZ]))
               {
                new 
string[128];
                
TextDrawShowForPlayer(playeridIBI0);
                
TextDrawShowForPlayer(playeridIBI1);
                
TextDrawShowForPlayer(playeridIBI2);
                
TextDrawShowForPlayer(playeridIBI3);
                   
format(stringsizeof(string), "%s"InfoBoardInfo[i][InfoBoardTDstring]);
                
TextDrawSetString(IBITDstring);
                
TextDrawShowForPlayer(playeridIBITD);
                
InfoBoardTimer SetTimer("HideTDInfo",500,0);
                return 
1;
            }
        }
    } 
PHP код:
public HideTDInfo(playerid)
{
     
TextDrawHideForPlayer(playeridIBI0);
    
TextDrawHideForPlayer(playeridIBI1);
    
TextDrawHideForPlayer(playeridIBI2);
    
TextDrawHideForPlayer(playeridIBI3);
    
TextDrawHideForPlayer(playeridIBITD);
    return 
1;

- That is the first question.. Also - That system is dynamic , Which means you set the TD String In-Game.. However - Is there anyway to make lines IG ? Like.. "bla bla bla bla \n bla bla bla" - Instead of all going in one line ? Cause when I tried \n IG - It didn't work.


- Something else , once you create the Object , It doesn't get created INFRONT of you - It always faces a default angle - Anyway to fix it ? I want the object to be at the same angle as the player is - Here is the cmd :

PHP код:
dcmd_createInfoBoard(playeridparams[])
{
    new 
Usage[128], string[128];
    if( 
sscanfparams"s"Usage))
    {
        if( 
PlayerInfo[playerid][pAdmin] >= 1337)
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /createInfoBoard [name]" );
            
SendClientMessage(playeridCOLOR_GREY"Available Names: Exterior and Complete" );
        }
    }
    else
    {
        if(
PlayerInfo[playerid][pAdmin] >= 1337)
        {
            if(
strcmp(Usage"exterior"true) == 0)
            {
                
PlayerInfo[playerid][InfoBoardExterior]++;
                
GetPlayerPosplayeridPlayerInfo[playerid][dExtX], PlayerInfo[playerid][dExtY], PlayerInfo[playerid][dExtZ]);
                
GetPlayerFacingAngle(playeridPlayerInfo[playerid][dAngle]);
                 
formatstringsizeof( string ), "Exterior set! (X: %f, Y: %f, Z: %f, A: %f)."PlayerInfo[playerid][dExtX], PlayerInfo[playerid][dExtY], PlayerInfo[playerid][dExtZ], PlayerInfo[playerid][dAngle]);
                  
SendClientMessageplayeridCOLOR_WHITEstring);
               }
               if(
strcmp(Usage"complete"true) == 0)
               {
                   if(
PlayerInfo[playerid][InfoBoardExterior] > 0)
                {
                        new 
NewInfoBoardID SpawnedInfoBoard+1;
                      if(
NewInfoBoardID >= MAX_InfoBoard)
                       {
                        
SendClientMessageplayeridCOLOR_WHITE"Too many InfoBoards are currently spawned!");
                     }
                     
formatstringsizeof( string ), "InfoBoards/InfoBoard_%d.ini"NewInfoBoardID);
                     if(
dini_Exists(string))
                     {
                        
SpawnedInfoBoard++;
                         
formatstringsizeof( string ), "InfoBoard (ID: %d) already exist!"NewInfoBoardID);
                           
SendClientMessageplayeridCOLOR_GREYstring);
                         
SendClientMessageplayeridCOLOR_YELLOW"Please try again by typing /createInfoBoard complete" );
                      }
                      else
                      {
                        
InfoBoardInfo[NewInfoBoardID][InfoBoardX] = PlayerInfo[playerid][dExtX];
                        
InfoBoardInfo[NewInfoBoardID][InfoBoardY] = PlayerInfo[playerid][dExtY];
                        
InfoBoardInfo[NewInfoBoardID][InfoBoardZ] = PlayerInfo[playerid][dExtZ];
                          
InfoBoardInfo[NewInfoBoardID][InfoBoardAngle] = PlayerInfo[playerid][dAngle];
                        
dini_Create(string);
                           
dini_FloatSetstring"X"InfoBoardInfo[NewInfoBoardID][InfoBoardX]);
                        
dini_FloatSetstring"Y"InfoBoardInfo[NewInfoBoardID][InfoBoardY]);
                        
dini_FloatSetstring"Z"InfoBoardInfo[NewInfoBoardID][InfoBoardZ]);
                        
dini_FloatSetstring"Angle"InfoBoardInfo[NewInfoBoardID][InfoBoardAngle]);
                        
PlayerInfo[playerid][InfoBoardExterior]--;
                        
SpawnedInfoBoard++;
                        
InfoBoardInfo[NewInfoBoardID][InfoBoardPickupID] = CreateDynamicPickup(123923,InfoBoardInfo[NewInfoBoardID][InfoBoardX], InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]);
                        
InfoBoardInfo[NewInfoBoardID][InfoBoardObjectID] = CreateDynamicObject(2737InfoBoardInfo[NewInfoBoardID][InfoBoardX]+0.7InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]+0.200InfoBoardInfo[NewInfoBoardID][InfoBoardAngle],0,0,-1,250);
                        
format(stringsizeof(string), "{A90202}Information Board ID : {FFF1AF}%d"NewInfoBoardID);
                        
InfoBoard[NewInfoBoardID] = CreateDynamic3DTextLabel(stringCOLOR_DCHATInfoBoardInfo[NewInfoBoardID][InfoBoardX],
                         
InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1100.0);
                           
SendClientMessageplayeridCOLOR_LIGHTBLUE"Successfully created an Info-Board!" );
                          
format(stringsizeof( string ), "You can now use /deleteInfoBoard in any Case - Information Board ID : %d)."NewInfoBoardID);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                    }
                  }
              }
        }
        else
        {
            
SendClientMessageplayeridCOLOR_GREY"You are not authorized to use this command!" );
        }
    }
    return 
1;

And since no body wanna help.. I am offering 5 USD via paypal if you actually fix it :/
Reply
#2

show us the lines where you create the textdraw, probably under ongamemodeinit/onfilterscriptinit
Reply
#3

PHP код:
IBI0 TextDrawCreate(157.000000230.000000"-");
        
TextDrawBackgroundColor(IBI0255);
        
TextDrawFont(IBI01);
        
TextDrawLetterSize(IBI00.01999916.899999);
        
TextDrawColor(IBI0, -1);
        
TextDrawSetOutline(IBI00);
        
TextDrawSetProportional(IBI01);
        
TextDrawSetShadow(IBI01);
        
TextDrawUseBox(IBI01);
        
TextDrawBoxColor(IBI01852730990);
        
TextDrawTextSize(IBI0470.00000050.000000);

        
IBI1 TextDrawCreate(135.000000220.000000"-");
        
TextDrawBackgroundColor(IBI1255);
        
TextDrawFont(IBI11);
        
TextDrawLetterSize(IBI123.8000541.199999);
        
TextDrawColor(IBI1255);
        
TextDrawSetOutline(IBI10);
        
TextDrawSetProportional(IBI11);
        
TextDrawSetShadow(IBI11);

        
IBI2 TextDrawCreate(135.000000378.000000"-");
        
TextDrawBackgroundColor(IBI2255);
        
TextDrawFont(IBI21);
        
TextDrawLetterSize(IBI223.8000541.199999);
        
TextDrawColor(IBI2255);
        
TextDrawSetOutline(IBI20);
        
TextDrawSetProportional(IBI21);
        
TextDrawSetShadow(IBI21);

        
IBI3 TextDrawCreate(239.000000239.000000"Information Board");
        
TextDrawBackgroundColor(IBI3255);
        
TextDrawFont(IBI31);
        
TextDrawLetterSize(IBI30.5000001.000000);
        
TextDrawColor(IBI365535);
        
TextDrawSetOutline(IBI30);
        
TextDrawSetProportional(IBI31);
        
TextDrawSetShadow(IBI31);

        
IBITD TextDrawCreate(164.000000267.000000"Empty Information-Board [No Text]");
        
TextDrawBackgroundColor(IBITD255);
        
TextDrawFont(IBITD1);
        
TextDrawLetterSize(IBITD0.5000001.000000);
        
TextDrawColor(IBITD, -1);
        
TextDrawSetOutline(IBITD0);
        
TextDrawSetProportional(IBITD1);
        
TextDrawSetShadow(IBITD1); 
Reply
#4

Well first of all, you're running the timer after 500ms (0.5 second). This may cause some problems, as this timer hides the textdraw. You may try increasing this to about 5 seconds (5000 ms) instead, and see if it helps.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)