SA-MP Forums Archive
Incorrect Display Of Text... - 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: Incorrect Display Of Text... (/showthread.php?tid=658720)



Incorrect Display Of Text... - Michatex - 10.09.2018

Hello! I have a strange problem.

Код:
format(string, sizeof(string), "[%i] %s \n(PL)", playerid, PlayerName(playerid));
PlayerTEXT[playerid] = Create3DTextLabel(string, 0xEEFF99FF, 0.0, 0.0, 0.0, 15, 0, 1);
Attach3DTextLabelToPlayer(PlayerTEXT[playerid], playerid, 0.0, 0.0, 0.2);
PlayerData[playerid][Have3DText] = true;
It should attach text to the player, but attach it to pickup.
What's is wrong?


Re: Incorrect Display Of Text... - ShihabSoft - 10.09.2018

What do you mean? The code attaches that 3d text to the specified players. Do you want to attach it to a pickup?

You can't do that. Instead you gotta specify the exact location where you've created the pickup in the create3dtextlabel


Re: Incorrect Display Of Text... - Michatex - 10.09.2018



It should be above the player's head.


Re: Incorrect Display Of Text... - UFF - 10.09.2018

Код:
format(string, sizeof(string), "[%i] %s \n(PL)", playerid, PlayerName(playerid));
PlayerTEXT[playerid] = CreateDynamic3DTextLabel(string, 0xEEFF99FF,  0, 0, 0.39, 18.0, playerid, INVALID_VEHICLE_ID, 1);
PlayerData[playerid][Have3DText] = true;
Try this


Re: Incorrect Display Of Text... - Michatex - 10.09.2018

Код:
PlayerTEXT[playerid] = Create3DTextLabel(string, 0xEEFF99FF,  0, 0, 0.39, 18.0, playerid, INVALID_VEHICLE_ID, 1);
warning 202: number of arguments does not match definition

Unfortunately it does not work either.


Re: Incorrect Display Of Text... - UFF - 10.09.2018

Quote:
Originally Posted by Michatex
Посмотреть сообщение
Код:
PlayerTEXT[playerid] = Create3DTextLabel(string, 0xEEFF99FF,  0, 0, 0.39, 18.0, playerid, INVALID_VEHICLE_ID, 1);
warning 202: number of arguments does not match definition

Unfortunately it does not work either.
Sorry, i updated the code. Please re-check the code which i given above.


Re: Incorrect Display Of Text... - Michatex - 10.09.2018

Thank you.


Re: Incorrect Display Of Text... - jhonel - 10.09.2018

use CreateDynamic3DTextLabel

PHP код:
if(IsValidDynamic3DTextLabel(PlayerTEXT[playerid])) DestroyDynamic3DTextLabel(PlayerTEXT[playerid]);
format(stringsizeof(string), "[%i] %s \n(PL)"playeridPlayerName(playerid));
PlayerTEXT[playerid] = CreateDynamic3DTextLabel(string0xEEFF99FF0.00.00.310.0playerid);
PlayerData[playerid][Have3DText] = true



Re: Incorrect Display Of Text... - solstice_ - 10.09.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
format(string, sizeof(string), "[%i] %s \n(PL)", playerid, PlayerName(playerid));
PlayerTEXT[playerid] = CreateDynamic3DTextLabel(string, 0xEEFF99FF,  0, 0, 0.39, 18.0, playerid, INVALID_VEHICLE_ID, 1);
PlayerData[playerid][Have3DText] = true;
Try this
How about you explain your code and tell him what this means other than going around and just posting it?


Re: Incorrect Display Of Text... - UFF - 10.09.2018

Quote:
Originally Posted by willbedie
Посмотреть сообщение
How about you explain your code and tell him what this means other than going around and just posting it?
What's there to explain?
I just made it CreateDynamic3DTextLabel instead of Create3DTextLabel to be easier since CreateDynamic3DTextLabel has Attach3DTextLabelToPlayer in itself. To destroy that label use DestroyDynamic3DTextLabel(PlayerTEXT[playerid]);