OnPlayerPickUpPickup problem / House system.
#1

When ever i go onto the icon / pickup, it gives out false stuff.
Here's the code;
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
    {
        //new hid = PlayerInfo[playerid][HouseID];
        new string[98];
        for(new i = 1; i < MAX_HOUSES; i++)
        {
            if(i == pickupid) break;
            {
                if(HouseInfo[i][Owned])
                {
                    if(strcmp(GetName(playerid), HouseInfo[i][Owner], true))
                    {
                        new price = HouseInfo[pickupid][Price];
                        new percent = SELLPERCENT*price/100;
                        SendClientMessage(playerid, COLOR_NOTES, "[INFO] This is your house! You can enter it by pressing 'F'.");
                        format(string, sizeof(string), "[INFO] You can sell this house for %d$.", percent), SendClientMessage(playerid, COLOR_NOTES, string);
                        return 1;
                    }
                    else
                    {
                        format(string, sizeof(string), "[INFO] This house is owned by %s. If it's not locked, you can enter it by pressing 'F'", HouseInfo[i][Owner]);
                        SendClientMessage(playerid, COLOR_NOTES, string);
                        return 1;
                    }
                }
                else
                {
                    format(string, sizeof(string), "[INFO] This house is not owned, you can buy it for %d$, and enter it by pressing 'F'", HouseInfo[i][Price]);
                    SendClientMessage(playerid, COLOR_NOTES, string);
                    return 1;
                }
            }
        }
        return 1;
    }
I've been struggling with this for a quite a while now, and I still haven't figured out a way on how to fix this.
I've tried using the "pickupid", but then it didn't work at all.

It always says "This house is owned by *YourName, or someones else name here* ....", even though the house is not owned ( reloaded fs, created new houses etc.., still says that it's owned by me or someone else.. )
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)