SA-MP Forums Archive
Update3DTextLabelText | +REP - 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: Update3DTextLabelText | +REP (/showthread.php?tid=418576)



Update3DTextLabelText | +REP - Jaber_Brown - 25.02.2013

I got this
pawn Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if(HouseInfo[h][hOwned] == 0)
        {
            new string[140];
            format(string, 128, "%s\n  Owner: %s\n Price: %d$\n LS Time: %d",HouseInfo[h][hDiscription],HouseInfo[h][hOwner], HouseInfo[h][hValue],HouseInfo[h][hLevel]);
            Create3DTextLabel(string, 0x00AE00FF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
            //Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
            HouseInfo[h][hPickupID]=CreateDynamicPickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            pickups++;
        }
        if(HouseInfo[h][hOwned] == 1)
        {
            if(HouseInfo[h][hRentabil] == 0)
            {
                new string[140];
                format(string, 128, "%s\n  Owner: %s",HouseInfo[h][hDiscription],HouseInfo[h][hOwner], HouseInfo[h][hValue],HouseInfo[h][hLevel]);
                Create3DTextLabel(string, 0x00AE00FF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
                //Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
                HouseInfo[h][hPickupID]=CreateDynamicPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
                pickups++;
                }
                else
                {
                new string[140];
                format(string, 128, "%s\n  Owner: %s\n Rentable: %d$ (/rentroom)",HouseInfo[h][hDiscription],HouseInfo[h][hOwner], HouseInfo[h][hRent]);
                Create3DTextLabel(string, 0x00AE00FF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
                //Create3DTextLabel("[Property]",0x00AE00FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75, 25.0, 0);
                HouseInfo[h][hPickupID]=CreateDynamicPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
                pickups++;
                }
        }
    }

And i got this in /buyhouse command

pawn Код:
{
            new Float:oldposx, Float:oldposy, Float:oldposz;
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            for(new h = 0; h < sizeof(HouseInfo); h++)
            {
                if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
                {
                    if(PlayerInfo[playerid][pConnectTime] < HouseInfo[h][hLevel])
                    {
                        format(string, sizeof(string), "   You must be ConnevtTime %d to purchase this !", HouseInfo[h][hLevel]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(PlayerInfo[playerid][pHousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pHousekey]][hOwner], true) == 0)
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "   You already own a house, type /sellhouse if you want to buy this one !");
                        return 1;
                    }
                    if(GetPlayerPCash(playerid) >= HouseInfo[h][hValue])
                    {
                        PlayerInfo[playerid][pHousekey] = h;
                        HouseInfo[h][hOwned] = 1;
                        PlayerInfo2[HouseEntered][playerid] = h;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
                        GivePlayerPCash(playerid,-HouseInfo[h][hValue]);
                        SetPlayerInterior(playerid,HouseInfo[h][hInt]);
                        SetPlayerVirtualWorld(playerid,h+100);
                        DOO_SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
                        GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
                        PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
                        PlayerInfo[playerid][pLocal] = h;
                        DestroyDynamicPickup(HouseInfo[h][hPickupID]);
                        HouseInfo[h][hPickupID]=CreateDynamicPickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
                        SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new Purchase !");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new property help section !");
                        PlayerInfo2[HouseEntered][playerid] = h;
                        OnPlayerDataSave(playerid);
                        PlayerPlayMusic(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
What I want to do is when player buys the house it updates the labeltext from for sale to owned ... Can you guys help me do this ?


Re: Update3DTextLabelText | +REP - Blaeks - 25.02.2013

use function Update3DTextLabelText


Re: Update3DTextLabelText | +REP - Jaber_Brown - 25.02.2013

Yeah, I know, but I don't know how to use it, i tried, and it just creates a new 3D Text label under the old one


Re: Update3DTextLabelText | +REP - Jaber_Brown - 25.02.2013

Anyone please ?