Textdraw not showing. -
Fabyx15 - 03.12.2018
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;
}
Re: Textdraw not showing. -
ApolloScripter - 03.12.2018
Try this:
PHP код:
new PlayerText:hudjos[MAX_PLAYERS];
//Your Function
LoadTextDrawsPlayerid(playerid)
{
hudjos[playerid] = CreatePlayerTextDraw(playerid, 637.174377, 432.083404, "NUME / RPG.NEVER-END.RO");
PlayerTextDrawLetterSize(playerid, hudjos[playerid], 0.365797, 1.629166);
PlayerTextDrawTextSize(playerid, hudjos[playerid], 26.000000, 0.000000);
PlayerTextDrawAlignment(playerid, hudjos[playerid], 3);
PlayerTextDrawColor(playerid, hudjos[playerid], -1);
PlayerTextDrawSetShadow(playerid, hudjos[playerid], -1);
PlayerTextDrawSetOutline(playerid, hudjos[playerid], -1);
PlayerTextDrawBackgroundColor(playerid, hudjos[playerid], 255);
PlayerTextDrawFont(playerid, hudjos[playerid], 2);
PlayerTextDrawSetProportional(playerid, hudjos[playerid], 1);
PlayerTextDrawShow(playerid, hudjos[playerid]);
}
// OnPlayerConnect
public OnPlayerConnect(playerid)
{
new string[256], name;
LoadTextDrawsPlayerid(playerid);
format(string, sizeof(string), "%s / RPG.NEVER-END.RO", GetName(name));
TextDrawSetString(Text:hudjos, string);
ResetAccount(playerid); >>>> Dont mind this
LoadMapPlayerid(playerid); >>>> Dont mind this
return 1;
}
Re: Textdraw not showing. -
Fabyx15 - 03.12.2018
Now it's showing the textdraw but not with the string..i mean it is showing NAME / RPG.etc...
Re: Textdraw not showing. -
ApolloScripter - 03.12.2018
Ops, I forgot a detail, change your "OnPlayerConnect" for this:
PHP код:
public OnPlayerConnect(playerid)
{
new string[256], name;
LoadTextDrawsPlayerid(playerid);
name = GetName(playerid);
format(string, sizeof(string), "%s / RPG.NEVER-END.RO", name);
PlayerTextDrawSetString(playerid, hudjos[playerid], string);
ResetAccount(playerid); >>>> Dont mind this
LoadMapPlayerid(playerid); >>>> Dont mind this
return 1;
}
Re: Textdraw not showing. -
Fabyx15 - 03.12.2018
Still the same with the name.
Re: Textdraw not showing. -
ApolloScripter - 03.12.2018
Quote:
Originally Posted by Fabyx15
Still the same with the name.
|
Are you sure that put this?
PHP код:
name = GetName(playerid);
format(string, sizeof(string), "%s / RPG.NEVER-END.RO", name)
Re: Textdraw not showing. -
Fabyx15 - 03.12.2018
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
Re: Textdraw not showing. -
ApolloScripter - 03.12.2018
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(playerid, 637.174377, 432.083404, "NUME / RPG.NEVER-END.RO");
PlayerTextDrawLetterSize(playerid, hudjos[playerid], 0.365797, 1.629166);
PlayerTextDrawTextSize(playerid, hudjos[playerid], 26.000000, 0.000000);
PlayerTextDrawAlignment(playerid, hudjos[playerid], 3);
PlayerTextDrawColor(playerid, hudjos[playerid], -1);
PlayerTextDrawSetShadow(playerid, hudjos[playerid], -1);
PlayerTextDrawSetOutline(playerid, hudjos[playerid], -1);
PlayerTextDrawBackgroundColor(playerid, hudjos[playerid], 255);
PlayerTextDrawFont(playerid, hudjos[playerid], 2);
PlayerTextDrawSetProportional(playerid, hudjos[playerid], 1);
PlayerTextDrawShow(playerid, hudjos[playerid]);
name[playerid] = GetName(playerid);
format(string, sizeof(string), "%s / RPG.NEVER-END.RO", name);
PlayerTextDrawSetString(playerid, hudjos[playerid], string);
}
//And edit OnPlayerConnect
public OnPlayerConnect(playerid)
{
LoadTextDrawsPlayerid(playerid);
ResetAccount(playerid); >>>> Dont mind this
LoadMapPlayerid(playerid); >>>> Dont mind this
return 1;
}
Re: Textdraw not showing. -
Fabyx15 - 03.12.2018
Yes thank you for your spent time, it is working now! Thanks mate, +1
Re: Textdraw not showing. -
GTLS - 04.12.2018
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.