Is it possible to update gametextforplayer?
#1

as in:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new string[256];

    for(new x = 0; x < MAX_HOUSES; x++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseEntX[x], HouseEntY[x], HouseEntZ[x]))
        {
            if(pickupid == HousePickup[x])
            {
                if(!(strcmp(HouseOwner[x], "nobody", true)))
                {
                    UnOwnedString[x] = format(string, sizeof(string), "~r~For Sale : %s~n~~w~Price: $%d~n~~b~Type '/buyhouse' to purchase.", HouseName[x], HousePrice[x]);
                }
                else
                {
                    OwnedString[x] = format(string, sizeof(string), "~g~Address:~w~ %s ~n~ ~g~Owner:~w~ %s", HouseName[x], HouseOwner[x]);
                }

                GameTextForPlayer(playerid, string, 3000, 5);
                break;
            }
        }
CANNOT FIGURE WHY THE HELL THAT WONT UPDATE!! Sorry for cap's been at it for 2 hours.
Reply
#2

What exactly do you mean by 'update'?
Reply
#3

Well when I /buyhouse, it wont call "else" i've tried replacing it with an if statement also.
Reply
#4

It would be better to have a boolean value to store whether a property is owned. Anyone can join with the name 'nobody'.
Reply
#5

I tried that also. But it didnt work at all! it just didnt work.

Edit: I created a variable called ForSale and if it was for sale then it would display the first one and if it wasnt i.e 0. It would return the "else", It just returned else all the time.
Reply
#6

Try this sir:

pawn Код:
if(strcmp(HouseOwner[x],"Nobody",true,5)) // This will check if it's not Nobody, but if it was, it would be if(!strcmp.
                {
                    OwnedString[x] = format(string, sizeof(string), "~g~Address:~w~ %s ~n~ ~g~Owner:~w~ %s", HouseName[x], HouseOwner[x]);
                }
                else
                {
                    UnOwnedString[x] = format(string, sizeof(string), "~r~For Sale : %s~n~~w~Price: $%d~n~~b~Type '/buyhouse' to purchase.", HouseName[x], HousePrice[x]);
                }
Reply
#7

Still does the exact same thing, I've tried a variable but it just returns else.
Reply
#8

Anyone else have an idea?
Reply
#9

pawn Код:
if(!strcmp(HouseOwner[x], "nobody", true))
Also make your string 128. The max string output of the client messages is 128.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)