Tell me whats wrong in this
#1

The code is creating confusion of a owned and unowned house. It's not even sometimes showing a gametext onpickuppickup

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new string[128];
    for(new h=0; h<sizeof(HouseInfo); h++)
    {
        if(pickupid == housepickup[h])
        {
            if(HouseInfo[h][hOwned])
            {
                format(string,sizeof(string), "~w~%s~n~~w~%s~n~~y~%d", HouseInfo[h][hOwner], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            else
            {
                format(string,sizeof(string), "~w~[House For Sale]~n~Price:~r~$%d~n~~w~%s~n~~y~%d", HouseInfo[h][hPrice], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            GameTextForPlayer(playerid, string, 5000, 5);
            return 1;
        }
    }
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new string[128];
    new string2[128];
    for(new h=0; h<sizeof(HouseInfo); h++)
    {
        if(pickupid == housepickup[h])
        {
            if(HouseInfo[h][hOwned])
            {
                format(string,sizeof(string), "~w~%s~n~~w~%s~n~~y~%d", HouseInfo[h][hOwner], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            else
            {
                format(string2,sizeof(string2), "~w~[House For Sale]~n~Price:~r~$%d~n~~w~%s~n~~y~%d", HouseInfo[h][hPrice], GetLocationArea(HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]), h);
            }
            GameTextForPlayer(playerid, string, 5000, 5);
            GameTextForPlayer(playerid, string2, 5000, 5);
            return 1;
        }
    }
    return 1;
}
I got the same problem with 1 string having 2 differents uses.Try that.
Reply
#3

Not working. It's kind of bugged, sometimes it creates a pickup shoing the house isn't owned and sometimes it shows that it is, even though the variable in the userfile says it is!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)