PDA

View Full Version : House System Help


conor565
11/06/2013, 07:30 PM
Hi, I want to edit the house system in my gamemode to when it is able to be bought, set it to the pickup ID 1273 and when it is bought set it to 1272. I am having a problem with this so if anyone could help me with this, I'd be very greatful.

Here is a snippet of the script in question:

if(HouseInfo[iIndex][hLevel] != 0)
{
if(HouseInfo[iIndex][hOwned])
{
if(HouseInfo[iIndex][hRentable] == 0) format(szFileStr, sizeof(szFileStr), "House owner: %s\n%d, Los Santos",HouseInfo[iIndex][hOwner],HouseInfo[iIndex][hLevel],iIndex);
else format(szFileStr, sizeof(szFileStr), "House owner: %s\nAddress: %d, Los Santos\nRent: $%d\nType /rentroom to rent a room",HouseInfo[iIndex][hOwner],iIndex,HouseInfo[iIndex][hRentFee]);
}
else format(szFileStr, sizeof(szFileStr), "This house is for sale!\nAddress: %d, Los Santos\nPrice: $%d\nTo buy this house type /buyhouse",HouseInfo[iIndex][hLevel],iIndex,HouseInfo[iIndex][hValue]);

HouseInfo[iIndex][hPickupID] = CreatePickup(1273, 23, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], -1);
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_HOUSEGREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
}
++iIndex;
}
return fclose(iFileHandle);
}

Aly
11/06/2013, 10:13 PM
if(HouseInfo[iIndex][hLevel] != 0)
{
if(HouseInfo[iIndex][hOwned])
{
if(HouseInfo[iIndex][hRentable] == 0) format(szFileStr, sizeof(szFileStr), "House owner: %s\n%d, Los Santos",HouseInfo[iIndex][hOwner],HouseInfo[iIndex][hLevel],iIndex);
else format(szFileStr, sizeof(szFileStr), "House owner: %s\nAddress: %d, Los Santos\nRent: $%d\nType /rentroom to rent a room",HouseInfo[iIndex][hOwner],iIndex,HouseInfo[iIndex][hRentFee]);
HouseInfo[iIndex][hPickupID] = CreatePickup(1272, 23, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], -1);
}
else
{
format(szFileStr, sizeof(szFileStr), "This house is for sale!\nAddress: %d, Los Santos\nPrice: $%d\nTo buy this house type /buyhouse",HouseInfo[iIndex][hLevel],iIndex,HouseInfo[iIndex][hValue]);
HouseInfo[iIndex][hPickupID] = CreatePickup(1273, 23, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ], -1);
}
HouseInfo[iIndex][hTextID] = CreateDynamic3DTextLabel(szFileStr, COLOR_HOUSEGREEN, HouseInfo[iIndex][hExteriorX], HouseInfo[iIndex][hExteriorY], HouseInfo[iIndex][hExteriorZ]+0.5,20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
}
++iIndex;
}
return fclose(iFileHandle);
}

conor565
12/06/2013, 06:09 PM
Thanks but I already fixed it, I forgot there was multiple places in the script where it destroyed then replaced the pickup.