SA-MP Forums Archive
Update3DTextLabel and some others not working - 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: Update3DTextLabel and some others not working (/showthread.php?tid=360376)



Update3DTextLabel and some others not working - Jochemd - 17.07.2012

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


Re: Update3DTextLabel and some others not working - CyNiC - 17.07.2012

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


Re: Update3DTextLabel and some others not working - Jochemd - 17.07.2012

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.


Re: Update3DTextLabel and some others not working - CyNiC - 17.07.2012

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.


Re: Update3DTextLabel and some others not working - Jochemd - 17.07.2012

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?


Re: Update3DTextLabel and some others not working - CyNiC - 18.07.2012

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.