Update3DTextLabel and some others not working
#1

Hello,

Take a look at the code below.

pawn Код:
else if(dialogid == DIALOG_SELLHOUSETOME)
    {
        new price = GetPVarInt(playerid,"SellingPrice"),seller = GetPVarInt(playerid,"SellingFrom"),h = GetPVarInt(playerid,"AtHouseID");
        if(response)
        {
            if(IsPlayerConnected(seller))
            {
                new Float:Pos[3];
                GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
                if(IsPlayerInRangeOfPoint(seller,5.0,Pos[0],Pos[1],Pos[2]))
                {
                    new string[75];
                    GivePlayerCash(playerid,-price);
                    GivePlayerCash(seller,price);
                    mysql_format(1,QueryString,"UPDATE `HouseInfo` SET `Owner` = '%s' WHERE `ID` = %d",PlayerName(playerid),h);
                    mysql_function_query(1,QueryString,false,"SomeNotExistingCallback","","");
                    format(HouseInfo[h][Owner],MAX_PLAYER_NAME,"%s",PlayerName(playerid));
                    SendFormatMessage(playerid,COLOR_WHITE,"You have successfully bought this house from {FFFF00}%s {FFFFFF}for {008000}$%d. {FFFFFF}Congratulations!",PlayerName(seller),price);
                    SendFormatMessage(seller,COLOR_WHITE,"You have successfully sold your house to {FFFF00}%s {FFFFFF}for {008000}$%d. {FFFFFF}Congratulations!",PlayerName(playerid),price);
                    format(string,sizeof(string),"[House -NOT for sale]\r\n{FFFF00}Owner: {FFFFFF}%s",PlayerName(playerid));
                    Update3DTextLabelText(HouseInfo[h][Label],COLOR_LIGHTGREEN,string);
                    return 1;
                }
                else return SendClientMessage(playerid,COLOR_RED,"(( Error: That player is not near you. ))");
            }
        }
        else
        {
            SendFormatMessage(playerid,COLOR_YELLOW,"You have declined %s's offer to purchase his house.",PlayerName(seller));
            SendFormatMessage(seller,COLOR_YELLOW,"%s has declined your offer to purchase your house.",PlayerName(playerid));
            return 1;
        }
    }
Update3DTextLabel does not work at all, and neither the 'format' which updated the owner name works. They simply do not change the texts. I even tried to set totally different (static) texts but they simply do not update. I am sure the IDs are right!

Maybe a SA-MP bug? At other places Update3DTextLabel works - weird.

Jochem
Reply
#2

How much is you sure? You did print the id or tried to delete the 3DText?
Reply
#3

Quote:
Originally Posted by CyNiC
Посмотреть сообщение
How much is you sure? You did print the id or tried to delete the 3DText?
Deleting does not affect the label at all. Besides, printing it is not possible.

Edit: Might have something to do with this >> https://sampforum.blast.hk/showthread.php?pid=1981429#pid1981429 - ****** said it's a buffer overflow there.
Reply
#4

Yes, I forgot that many times I came across this problem(overflow) and only got discover after make the server print everything he's doing in that piece of code.
Reply
#5

Quote:
Originally Posted by CyNiC
Посмотреть сообщение
Yes, I forgot that many times I came across this problem(overflow) and only got discover after make the server print everything he's doing in that piece of code.
Do you know how it happens and how to fix it?
Reply
#6

Did you or/and the seller received the buy message or sell message? If no, the problem is on SendFormatMessage or mysql functions, if yes, the problem is related with 3Dtext id mismatch.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)