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,3, factionInfo[i][facX], factionInfo[i][facY],factionInfo[i][facZ]))
{
new stringnamet[34];
format(stringnamet, sizeof(stringnamet), "%s", factionInfo[i][facName]);
new stringownert[34];
format(stringownert, sizeof(stringownert), "%s", factionInfo[i][fOwner]);
TextDrawSetString(STRINGOWNER, stringownert);
TextDrawShowForPlayer(playerid, EMPTYINFOBOX);
TextDrawShowForPlayer(playerid, PROPNAME);
TextDrawShowForPlayer(playerid, STRINGNAME);
TextDrawShowForPlayer(playerid, PROPADD);
TextDrawShowForPlayer(playerid, PROPOWNER);
TextDrawShowForPlayer(playerid, STRINGPROP);
TextDrawShowForPlayer(playerid, STRINGOWNER);
TextDrawShowForPlayer(playerid, PROPINFO);
TextDrawShowForPlayer(playerid, TEXTBOT);
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.000000, 160.000000, "facOwner");
TextDrawFont(STRINGOWNER, 1);
TextDrawLetterSize(STRINGOWNER, 0.312500, 1.500000);
TextDrawTextSize(STRINGOWNER, 400.000000, 17.000000);
TextDrawSetOutline(STRINGOWNER, 1);
TextDrawSetShadow(STRINGOWNER, 0);
TextDrawAlignment(STRINGOWNER, 3);
TextDrawColor(STRINGOWNER, -1);
TextDrawBackgroundColor(STRINGOWNER, 255);
TextDrawBoxColor(STRINGOWNER, 50);
TextDrawUseBox(STRINGOWNER, 0);
TextDrawSetProportional(STRINGOWNER, 1);
TextDrawSetSelectable(STRINGOWNER, 0);
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.