Problem With Text3D
#1

I have this code.
Код:
if(Player[playerid][PlayerReplaceSp] == 5)

{
GetPlayerPos(playerid,Player[playerid][PlayerPositionX5],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5]);
GetPlayerFacingAngle(playerid,Player[playerid][PlayerPositionA5]);
DeletePlayer3DTextLabel(playerid,Player[playerid][PlayerSp5Text3D]);
Player[playerid][PlayerSp5Text3D] = CreatePlayer3DTextLabel(playerid,"Zapisana Pozycja 5",0x00FF00FF,Player[playerid][PlayerPositionX2],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5],50);
SendClientMessage(playerid,0x00FF00FF,"(Serwer): Twoja pozycja została nadpisana, wpisz /Lp 5 aby się do niej przenieść, lub /Dp 5 aby usunąć.");
}
Its in gui and this is command.
Код:
if(strval(params) == 5)

{
if(Player[playerid][PlayerUseSp5] == 1)
{
   Player[playerid][PlayerReplaceSp] = 5;
   ShowPlayerDialog(playerid,DIALOG_REPLACE_SP,DIALOG_STYLE_MSGBOX,"Nadpisywanie Zapisanej Pozycji 5","Ta pozycja jest już zapisana, czy na pewno chcesz nią podmienić?","Ok","Anuluj");
   return 1;
}
GetPlayerPos(playerid,Player[playerid][PlayerPositionX5],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5]);
GetPlayerFacingAngle(playerid,Player[playerid][PlayerPositionA5]);
Player[playerid][PlayerUseSp5] = 1;
Player[playerid][PlayerSp5Text3D] = CreatePlayer3DTextLabel(playerid,"Zapisana Pozycja 5",0x00FF00FF,Player[playerid][PlayerPositionX5],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5],50);
SendClientMessage(playerid,0x00FF00FF,"(Serwer): Twoja pozycja została zapisana, wpisz /Lp 5 aby się do niej przenieść, lub /Dp 5 aby usunąć.");
}
And my problem its this, text3d after replace (gui) is removed and dont be created.
Reply
#2

Any help?
Reply
#3

Make sure that your conditions are full fill according to code , If you want to check if condition use else statement with them them print something like "Yeah! playerusesp5 is not 1" OR Something
Reply
#4

all of the code to perform but 3dtext is deleted and dont created again.
Reply
#5

Any help?
Reply
#6

You know your code here:

pawn Код:
if(Player[playerid][PlayerReplaceSp] == 5)

{
GetPlayerPos(playerid,Player[playerid][PlayerPositionX5],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5]);
GetPlayerFacingAngle(playerid,Player[playerid][PlayerPositionA5]);
DeletePlayer3DTextLabel(playerid,Player[playerid][PlayerSp5Text3D]);
Player[playerid][PlayerSp5Text3D] = CreatePlayer3DTextLabel(playerid,"Zapisana Pozycja 5",0x00FF00FF,Player[playerid][PlayerPositionX2],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5],50);
SendClientMessage(playerid,0x00FF00FF,"(Serwer): Twoja pozycja została nadpisana, wpisz /Lp 5 aby się do niej przenieść, lub /Dp 5 aby usunąć.");
}
Well I have spotted this

pawn Код:
Player[playerid][PlayerSp5Text3D] = CreatePlayer3DTextLabel(playerid,"Zapisana Pozycja 5",0x00FF00FF,Player[playerid][PlayerPositionX2],Player[playerid][PlayerPositionY5],Player[playerid][PlayerPositionZ5],50);
Here it says:

pawn Код:
Player[playerid][PlayerPositionX2]
Isn't it supposed to be PlayerPositionX5 instead of X2?
Reply
#7

Yes thank you for find bug and now all work, thank you all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)