18.02.2012, 16:30
Maybe.
pawn Код:
stock BuyHouse(playerid, houseid)
{
if (GetPlayerScore(playerid) >= 1000)
{
new string2[128];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
#if defined PRINT_HOUSES
printf("%s Bought House ID %d", name, houseid);
#endif
GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
format(string2,sizeof(string2), HOUSE_FILE, houseid);
INI_Open(string2);
INI_WriteString("Name", name);
INI_WriteInt("Locked", 0);
INI_Save();
INI_Close();
hInfo[houseid][Name] = name;
hInfo[houseid][Locked] = 0;
DestroyPickup(HousePickup[houseid]);
HousePickup[houseid] = CreatePickup(1272, 23, hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY], hInfo[houseid][ExteriorZ]);
ShowBoughtHouseMessage(playerid);
}
return 1;
}