SA-MP Forums Archive
textdraw set string not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: textdraw set string not working (/showthread.php?tid=658408)



textdraw set string not working - yllo - 03.09.2018

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);
                }
            } 



Re: textdraw set string not working - ShihabSoft - 03.09.2018

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


Re: textdraw set string not working - yllo - 05.09.2018

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


Re: textdraw set string not working - NaS - 05.09.2018

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?


Re: textdraw set string not working - yllo - 05.09.2018

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.


Re: textdraw set string not working - ShihabSoft - 05.09.2018

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.