House Commands Help
#1

Hello, I recently made a /sellhouse and /acceptbuyhouse and when ever i sell my house to someone and they accept it, The name changes of the house when your near the door but i can still lock and every thing even though i just sold it ?

Also when i sell it to some one and then that person sells it to someone else the name dont change


Please Help


pawn Код:
command(sellhouse, playerid, params[])
{
    new id, Nam2[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], price, string[128], string2[128];
    if(sscanf(params, "ddd", housenumber, id, price)) return SendClientMessage(playerid, GREEN, "/sellhouse [YourHouseID] [ID] [Price]");
    if(Player[playerid][InHouse] == 0)
        return SendClientMessage(playerid, RED, "You must be in your house to sell it");
    GetPlayerName(playerid,Nam2,MAX_PLAYER_NAME);//define the playerid name
    GetPlayerName(id,pname,MAX_PLAYER_NAME);//define the other person name
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player is not on line");
    format(string,sizeof(string), "You have offered to sell your house to %s for %d", pname, price);
    format(string2,sizeof(string2), "You have been offered to buy %s's house for %d, Type /acceptbuyhouse to buy it", Nam2, price);
    SendClientMessage(playerid, GREEN, string);
    SendClientMessage(id, GREEN, string2);
    Player[id][OfferedHouse] = 1;
    return 1;
}

command(acceptbuyhouse, playerid, params[])
{
    new id, Nam2[MAX_PLAYER_NAME],string[48], pname[MAX_PLAYER_NAME];
    if(Player[playerid][OfferedHouse] == 1)
    {
        GetPlayerName(playerid,Nam2,MAX_PLAYER_NAME);//define the playerid name
        GetPlayerName(id,pname,MAX_PLAYER_NAME);//define the other person name
        format(string, sizeof(string), "Houses/House_%d.ini", housenumber);
        if(fexist(string))
        {
            format(string, sizeof(string), "Accounts/%s.ini", Nam2);
            if(fexist(string))
            {
                dini_IntSet(string, "House", 0);
            }
            format(string, sizeof(string), "Accounts/%s.ini", pname);
            if(fexist(string))
            {
                dini_IntSet(string, "House", housenumber);
            }
           
            format(Houses[housenumber][hOwner], 255, "%s", pname);
            format(string, sizeof(string), "%s Has sold his house to %s", pname, Nam2);
            SendClientMessageToAll(WHITE, string);
            SaveHouses();
            Player[playerid][OfferedHouse] = 0;
        }
    }
    else
    {
        SendClientMessage(playerid, WHITE, "You are not being offered a house");
    }
    return 1;
}
Thank You
Reply
#2

It never says anything about the player actually selling the house
pawn Код:
OwnedHouse = 0;
Reply
#3

What do you mean ?


Thank You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)