3DText
#1

How to create when the player buyes the house and update the 3DText ?
pawn Код:
if(strcmp(cmd, "/buyhouse", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            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][pLevel] < HouseInfo[h][hLevel])
                    {
                        format(string, sizeof(string), "   Mora da ste level %d da go kupite ova !", HouseInfo[h][hLevel]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "   vekje poseduvate kuca /sellhouse dokolku sakate da ja kupite ova !");
                        return 1;
                    }
                    if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
                    {
                        PlayerInfo[playerid][pPhousekey] = h;
                        HouseInfo[h][hOwned] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
                        GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
                        SetPlayerInterior(playerid,HouseInfo[h][hInt]);
                        SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
                        GameTextForPlayer(playerid, "~w~Dobrodojdovte doma~n~Moze da izlezete koga sakate,treba da se doblizite do vrata i da napisete /exit", 5000, 3);
                        PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
                        PlayerInfo[playerid][pLocal] = h;
                        SendClientMessage(playerid, COLOR_WHITE, "Vi Cestitame, Na vasata nova nabavka !");
                        SendClientMessage(playerid, COLOR_WHITE, "Napisete /help za povekje informacii za kuca !");
                        DateProp(playerid);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "   Nemate dovolno pari za ova !");
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

What you mean?
Use
pawn Код:
Create3DTextLabel("I'm at the coordinates:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
Reply
#3

I have a 3dtext when the server starts but when the player bought the house the 3DTEXT is standing the same(The House is for Sale)how to make it update when the player bought the house ?
Reply
#4

You are using
pawn Код:
HouseInfo[h][hOwned] = 1;
Great ok, Detect if house is Owned and Remove the old 3dtext and add a new one. (You know how to do that right?)
Reply
#5

i don't know :/
Reply
#6

Thats just an example how to do
pawn Код:
if(HouseInfo[h][hOwned] == 1)
{
//Your Codes
//Old Label
Delete3DTextLabel(unowned);
//Example
owned = Create3DTextLabel(....);
}
Do like that.. what rudy_ said
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)