One House Per Player
#2

Just add in your PlayerInfo a variable which marks if the player owns a house or not
PHP код:
// pInfo
    
House,
//BuyHouse
    
if(GetPlayerMoney(playerid) > HouseInfo[houseid][Price]) { // guess you forgot that
        
return SendClientMessage(playerid, -1"You don't have enough money!");
    }
    if(
PlayerInfo[playerid][House] != -1) {
        return 
SendClientMessage(playerid, -1"You already own a house!");
    }
    
PlayerInfo[playerid][House] = houseid;
//SellHouse
    
if(PlayerInfo[playerid][House] == -1) {
        return 
SendClientMessage(playerid, -1"You don't own a house!");
    }
    
PlayerInfo[playerid][House] = -1;
//At register
    
PlayerInfo[playerid][House] = -1// or any other invalid id
// at login, load variable from file
// at disconnect, save variable to file 
I think that's enough help, the rest is up to you
Reply


Messages In This Thread
One House Per Player - by CrazyPerry - 14.12.2015, 09:18
Re: One House Per Player - by Nero_3D - 14.12.2015, 10:54
Re: One House Per Player - by sidney123 - 14.12.2015, 10:54
Re: One House Per Player - by CrazyPerry - 14.12.2015, 21:15

Forum Jump:


Users browsing this thread: 1 Guest(s)