House System Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: House System Help (
/showthread.php?tid=443352)
House System Help -
conor565 - 11.06.2013
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:
pawn Код:
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);
}
Re: House System Help -
Aly - 11.06.2013
pawn Код:
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);
}
Re: House System Help -
conor565 - 12.06.2013
Thanks but I already fixed it, I forgot there was multiple places in the script where it destroyed then replaced the pickup.