12.10.2016, 20:09
Hello, I would like to add an option if you change the exterior to add a street name how can I add here:
That I'm able to add a street name only by "exterior" ?
See option exterior:
Also, how can I make a new option to only edit the street name ?
PHP код:
new string[128], choice[32], houseid, amount;
if(sscanf(params, "s[32]dD", choice, houseid, amount))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hedit [name] [houseid] [(Optional)amount]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, CustomExterior, Level, Price");
return 1;
}
See option exterior:
PHP код:
else if(strcmp(choice, "exterior", true) == 0)
{
GetPlayerPos(playerid, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]);
GetPlayerFacingAngle(playerid, HouseInfo[houseid][hExteriorA]);
SendClientMessage(playerid, COLOR_WHITE, "You have changed the exterior!");
DestroyPickup(HouseInfo[houseid][hPickupID]);
SaveHouses();
format(string, sizeof(string), "%s has edited HouseID %d's Exterior.", GetPlayerNameEx(playerid), houseid);
Log("logs/hedit.log", string);
if(HouseInfo[houseid][hOwned] ==0)
{
DestroyPickup(HouseInfo[houseid][hPickupID]);
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
format(string, sizeof(string), "This house is for sale!\n Level: %d\nID: %d\nPrice: $%d\nTo buy this house type /buyhouse",HouseInfo[houseid][hLevel],houseid,HouseInfo[houseid][hValue]);
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(string, COLOR_HOUSEGREEN, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
HouseInfo[houseid][hPickupID] = CreatePickup(19524, 23, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
}
else
{
if(HouseInfo[houseid][hRentable] == 0)
{
DestroyPickup(HouseInfo[houseid][hPickupID]);
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
format(string, sizeof(string), "House owner: %s\nLevel: %d\nID: %d",HouseInfo[houseid][hOwner],HouseInfo[houseid][hLevel],houseid);
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(string,COLOR_HOUSEGREEN,HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
HouseInfo[houseid][hPickupID] = CreatePickup(19522, 23, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
}
else
{
DestroyPickup(HouseInfo[houseid][hPickupID]);
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
format(string, sizeof(string), "House owner: %s\nLevel: %d\nID: %d\nRent: $%d\nType /rentroom to rent a room",HouseInfo[houseid][hOwner],HouseInfo[houseid][hLevel],houseid,HouseInfo[houseid][hRentFee]);
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(string,COLOR_HOUSEGREEN,HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
HouseInfo[houseid][hPickupID] = CreatePickup(19523, 23, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
}
}
}