Textdraw not showing.
#1

So i made textdraws for a server logo. I tried my best and when i join the server the textdraw is not showing at all. I dont know what's wrong maybe the TextDrawSetString or idk..Here is the code.

Here is the global variable on top
Код:
new PlayerText:hudjos;
Then i made a public to show textdraw

Код:
forward LoadTextDrawsPlayerid(playerid);
public LoadTextDrawsPlayerid(playerid)
{
	hudjos = CreatePlayerTextDraw(playerid, 637.174377, 432.083404, "NUME / RPG.NEVER-END.RO");
	PlayerTextDrawLetterSize(playerid, hudjos, 0.365797, 1.629166);
	PlayerTextDrawTextSize(playerid, hudjos, 26.000000, 0.000000);
	PlayerTextDrawAlignment(playerid, hudjos, 3);
	PlayerTextDrawColor(playerid, hudjos, -1);
	PlayerTextDrawSetShadow(playerid, hudjos, -1);
	PlayerTextDrawSetOutline(playerid, hudjos, -1);
	PlayerTextDrawBackgroundColor(playerid, hudjos, 255);
	PlayerTextDrawFont(playerid, hudjos, 2);
	PlayerTextDrawSetProportional(playerid, hudjos, 1);

	return 1;
}
Then this is the last.
Код:
public OnPlayerConnect(playerid)
{
	new string[256], name;
	LoadTextDrawsPlayerid(playerid);
	format(string, sizeof(string), "%s / RPG.NEVER-END.RO", GetName(name));
	TextDrawSetString(Text:hudjos, string);
	TextDrawShowForPlayer(playerid, Text:hudjos);
	ResetAccount(playerid); >>>> Dont mind this
	LoadMapPlayerid(playerid); >>>> Dont mind this
	return 1;
}
Reply
#2

Try this:

PHP код:
new PlayerText:hudjos[MAX_PLAYERS];
//Your Function
LoadTextDrawsPlayerid(playerid)
{
    
hudjos[playerid] = CreatePlayerTextDraw(playerid637.174377432.083404"NUME / RPG.NEVER-END.RO");
    
PlayerTextDrawLetterSize(playeridhudjos[playerid], 0.3657971.629166);
    
PlayerTextDrawTextSize(playeridhudjos[playerid], 26.0000000.000000);
    
PlayerTextDrawAlignment(playeridhudjos[playerid], 3);
    
PlayerTextDrawColor(playeridhudjos[playerid], -1);
    
PlayerTextDrawSetShadow(playeridhudjos[playerid], -1);
    
PlayerTextDrawSetOutline(playeridhudjos[playerid], -1);
    
PlayerTextDrawBackgroundColor(playeridhudjos[playerid], 255);
    
PlayerTextDrawFont(playeridhudjos[playerid], 2);
    
PlayerTextDrawSetProportional(playeridhudjos[playerid], 1);
    
PlayerTextDrawShow(playeridhudjos[playerid]);
}
// OnPlayerConnect
public OnPlayerConnect(playerid)
{
    new 
string[256], name;
    
LoadTextDrawsPlayerid(playerid);
    
format(stringsizeof(string), "%s / RPG.NEVER-END.RO"GetName(name));
    
TextDrawSetString(Text:hudjosstring);
    
ResetAccount(playerid); >>>> Dont mind this
    LoadMapPlayerid
(playerid); >>>> Dont mind this
    
return 1;

Reply
#3

Now it's showing the textdraw but not with the string..i mean it is showing NAME / RPG.etc...
Reply
#4

Ops, I forgot a detail, change your "OnPlayerConnect" for this:

PHP код:
public OnPlayerConnect(playerid)
{
    new 
string[256], name;
    
LoadTextDrawsPlayerid(playerid);
    
name GetName(playerid);
    
format(stringsizeof(string), "%s / RPG.NEVER-END.RO"name);
    
PlayerTextDrawSetString(playeridhudjos[playerid], string);
    
ResetAccount(playerid); >>>> Dont mind this
    LoadMapPlayerid
(playerid); >>>> Dont mind this
    
return 1;

Reply
#5

Still the same with the name.
Reply
#6

Quote:
Originally Posted by Fabyx15
Посмотреть сообщение
Still the same with the name.
Are you sure that put this?

PHP код:
    name GetName(playerid);
    
format(stringsizeof(string), "%s / RPG.NEVER-END.RO"name
Reply
#7

yep.. i put name[56]; on the new because i would get this error error 006: must be assigned to an array, i put the new name[56]; and it still not showing the name
Reply
#8

I'm not the smartest to help, but I'm trying

Try to change in your function
PHP код:
LoadTextDrawsPlayerid(playerid)
{
    new 
name[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME 30];
    
    
hudjos[playerid] = CreatePlayerTextDraw(playerid637.174377432.083404"NUME / RPG.NEVER-END.RO");
    
PlayerTextDrawLetterSize(playeridhudjos[playerid], 0.3657971.629166);
    
PlayerTextDrawTextSize(playeridhudjos[playerid], 26.0000000.000000);
    
PlayerTextDrawAlignment(playeridhudjos[playerid], 3);
    
PlayerTextDrawColor(playeridhudjos[playerid], -1);
    
PlayerTextDrawSetShadow(playeridhudjos[playerid], -1);
    
PlayerTextDrawSetOutline(playeridhudjos[playerid], -1);
    
PlayerTextDrawBackgroundColor(playeridhudjos[playerid], 255);
    
PlayerTextDrawFont(playeridhudjos[playerid], 2);
    
PlayerTextDrawSetProportional(playeridhudjos[playerid], 1);
    
PlayerTextDrawShow(playeridhudjos[playerid]);
    
name[playerid] = GetName(playerid);
    
format(stringsizeof(string), "%s / RPG.NEVER-END.RO"name);
    
PlayerTextDrawSetString(playeridhudjos[playerid], string); 

//And edit OnPlayerConnect
public OnPlayerConnect(playerid)
{
    
LoadTextDrawsPlayerid(playerid);
    
ResetAccount(playerid); >>>> Dont mind this
    LoadMapPlayerid
(playerid); >>>> Dont mind this
    
return 1;

Reply
#9

Yes thank you for your spent time, it is working now! Thanks mate, +1
Reply
#10

Its a bit of common sense, that you have to change the string before showing it. Or else, you have to re-show it to player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)