PDA

View Full Version : Label doesn't show.


HY
10/01/2015, 05:45 PM
Hello.. So, I want start creating Dynamic House System, for my server, but I have a problem.

So, when I use command, everything works fine, but the issue it's my label isn't showin'. I can see him 1-2 seconds, then he disapper.
I tried to make with streamer, CreateDynamic3DTextLabel(....) but then my server doesn't recognize command and it's givin' to me "SERVER: Unknown command"...

What's wrong in lines.

format(labelstring, sizeof(labelstring), "{15FF00}Casă ID: {FFFFFF}%d\n{15FF00}Pret: {FFFFFF}%i\n{15FF00}Interior: {FFFFFF}%i\n\n{15FF00}Scrie {FFFFFF}/Cumpara {15FF00}pentru a cumpăra casa.", casaid, Pret, Interior);

And here creating label:

CasaInfo[casaid][cLabel] = Create3DTextLabel(labelstring, 0xFFFFFFFF, X, Y, Z, 40.0, -1);

Whole code:

CMD:crearecasa(playerid, params[])
{
new Pret, Interior, string[128], name[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z, labelstring[144];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, X, Y, Z);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nu esti autorizat să folosesti această comandă.");
if(sscanf(params, "ii", Pret, Interior)) return SendClientMessage(playerid, -1, "{FF0000}Folosire: {FFFFFF}/CreareCasa [Pret] [Interior]");
if(Pret > 1000000 || Pret < 1) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Pret invalid. [1 - 1,000,000 $]");
if(Interior > 10 || Interior < 1) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Interior invalid. [1 - 10]");
format(string, sizeof(string), "{FF0000}[INFO]: {FFFFFF}Casă ID: {FF0000}%d {FFFFFF}cu pretul: {FF0000}%i {FFFFFF}a fost creată.", casaid, Pret);
SendClientMessage(playerid, -1, string);
printf("Administrator-ul %s a creat casa: %d cu pretul: %i si interiorul: %i.", name, casaid, Pret, Interior);
format(labelstring, sizeof(labelstring), "{15FF00}Casă ID: {FFFFFF}%d\n{15FF00}Pret: {FFFFFF}%i\n{15FF00}Interior: {FFFFFF}%i\n\n{15FF00}Scrie {FFFFFF}/Cumpara {15FF00}pentru a cumpăra casa.", casaid, Pret, Interior);
CasaInfo[casaid][cInterior] = Interior;
CasaInfo[casaid][cPret] = Pret;
CasaInfo[casaid][cIncuiata] = 0;
CasaInfo[casaid][cOwned] = 0;
CasaInfo[casaid][cX] = X;
CasaInfo[casaid][cY] = Y;
CasaInfo[casaid][cZ] = Z;
CasaInfo[casaid][cPick] = CreatePickup(1273, 1, X, Y, Z, -1);
CasaInfo[casaid][cLabel] = Create3DTextLabel(labelstring, 0xFFFFFFFF, X, Y, Z, 40.0, -1);
new INI:File = INI_Open(CasaPath());
INI_WriteInt(File, "Interior", Interior);
INI_WriteInt(File, "Pret", Pret);
INI_WriteInt(File, "Incuiata", 0);
INI_WriteInt(File, "Cumpărată", 0);
INI_WriteFloat(File, "Pozitie X", X);
INI_WriteFloat(File, "Pozitie Y", Y);
INI_WriteFloat(File, "Pozitie Z", Z);
INI_Close(File);
casaid++;
return 1;
}

HY
10/01/2015, 07:06 PM
Bump. Nobody? ..

bgedition
10/01/2015, 07:11 PM
label string must be with longer length
your labelstring are for 144 symbols but in to the format are 148 symbols

HY
11/01/2015, 06:38 AM
No, doesn't works... Anybody else?

Sawalha
11/01/2015, 06:51 AM
Create3DTextLabel(labelstring, 0xFFFFFFFF, X, Y, Z, 40.0, 0, 0);

what's -1 for? the normal world is 0, testLOS is normally 0
also, make your labelstring 150 abit, 144 is not enough

HY
11/01/2015, 08:22 AM
Ow. Thank you very much.

+ Rep.