textdraw set string not working
#1

I am trying to set a textdraw's string but for some reason it does not work. The textdraws are defined and all it shows is what is defined in the script. Please help,

PHP код:
if(IsPlayerInRangeOfPoint(id,3factionInfo[i][facX], factionInfo[i][facY],factionInfo[i][facZ]))
                {
                       new 
stringnamet[34];
                    
format(stringnametsizeof(stringnamet), "%s"factionInfo[i][facName]);
                    new 
stringownert[34];
                    
format(stringownertsizeof(stringownert), "%s"factionInfo[i][fOwner]);
                    
TextDrawSetString(STRINGOWNERstringownert);
                    
TextDrawShowForPlayer(playeridEMPTYINFOBOX);
                    
TextDrawShowForPlayer(playeridPROPNAME);
                    
TextDrawShowForPlayer(playeridSTRINGNAME);
                    
TextDrawShowForPlayer(playeridPROPADD);
                    
TextDrawShowForPlayer(playeridPROPOWNER);
                    
TextDrawShowForPlayer(playeridSTRINGPROP);
                    
TextDrawShowForPlayer(playeridSTRINGOWNER);
                    
TextDrawShowForPlayer(playeridPROPINFO);
                    
TextDrawShowForPlayer(playeridTEXTBOT);
                    
SetTimer("PlayerInfoRangeHide",7000,1);
                }
            } 
Reply
#2

What do you see in the screen? Are the textdraws being shown? What's missing?
Reply
#3

I can only seen whats been defined in the script under the textdraw create, which is "facName" but does not update to show what is in under that icon id in the mysql, which shgould be: "CSPD" The formatting works perfectly as I have tried setting a sendclientmessage to the player with whats formatted but my textdraw wont update to show it. I am a bit confused
Reply
#4

Those should probably be PlayerTextDraws. If another player enters a similar info point (or what you call it) it will overwrite the TextDraw and the other player will see different info.

The timer at the bottom also shouldn't be repeating if I'm not mistaken, otherwise it will trigger a new repeating timer everytime someone enters which will result in a lot of timers after some while.

For the issue you have, can you show us how you create the TextDraw?
Reply
#5

PHP код:
    STRINGOWNER TextDrawCreate(549.000000160.000000"facOwner");
    
TextDrawFont(STRINGOWNER1);
    
TextDrawLetterSize(STRINGOWNER0.3125001.500000);
    
TextDrawTextSize(STRINGOWNER400.00000017.000000);
    
TextDrawSetOutline(STRINGOWNER1);
    
TextDrawSetShadow(STRINGOWNER0);
    
TextDrawAlignment(STRINGOWNER3);
    
TextDrawColor(STRINGOWNER, -1);
    
TextDrawBackgroundColor(STRINGOWNER255);
    
TextDrawBoxColor(STRINGOWNER50);
    
TextDrawUseBox(STRINGOWNER0);
    
TextDrawSetProportional(STRINGOWNER1);
    
TextDrawSetSelectable(STRINGOWNER0); 
Thsi is how I create them for an example.
Reply
#6

That should be a PlayerTextDraw, consider if multiple players get to that location, your code just keep on changing the text in it repeatedly, which will be visible for everyone around.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)