19.11.2011, 06:40
this is not smart as garhouse ! thnanks
// Check if the player has room for another house (he hasn't bought the maximum amount of houses per player yet) // and get the slot-id for (new HouseIndex; HouseIndex < MAX_HOUSESPERPLAYER; HouseIndex++) // Loop through all house-slots of the player if (APlayerData[playerid][Houses][HouseIndex] == 0) // Check if this house slot is free return HouseIndex; // Return the free HouseIndex for this player
// his function returns "1" if the given player is the owner of the given house House_PlayerIsOwner(playerid, HouseID) { // Loop through all houses owner by this player for (new i; i < MAX_HOUSESPERPLAYER; i++) { // Check if the player owns the house in any of his house-slots if (APlayerData[playerid][Houses][i] == HouseID) return 1; } // If the player doesn't own the house, return 0 return 0;