forward AddHouse(playerid, houseid, interiorid, cost, Float:xx, Float:yy, Float:zz);
enum hInfo { hHouseId, hHouseInterior, Float:hHousex, Float:hHousey, Float:hHousez, hHouseCost, hHouseOwnerId, hHouseOwnerName[16], hHouseLocked, };
new HouseInfo[MAX_HOUSES][hInfo]; new HousePickup[MAX_HOUSES]; new houses;
public AddHouse(playerid, houseid, interiorid, cost, Float:xx, Float:yy, Float:zz) { new string[128]; format(string, sizeof(string), "%s.cer", houses + 1); new File:hFile; hFile = fopen(string, io_append); HouseInfo[houseid][hHouseCost] = cost; HouseInfo[houseid][hHouseInterior] = interiorid; HouseInfo[houseid][hHouseId] = houseid; HouseInfo[houseid][hHouseLocked] = 1; GetPlayerPos(playerid, xx, yy, zz); HouseInfo[houseid][hHousex] = xx; HouseInfo[houseid][hHousey] = yy; HouseInfo[houseid][hHousez] = zz; new stringowner[16]; format(stringowner, sizeof(stringowner), "None"); HouseInfo[houseid][hHouseOwnerName] = stringowner; HouseInfo[houseid][hHouseOwnerId] = 255; HousePickup[houseid] = CreatePickup(1273,1,xx,yy,zz); new var[32];// format(var, 32, "%s\n", HouseInfo[playerid][hHouseOwnerName]);fwrite(hFile, var); format(var, 32, "HouseOwnerId=%d\n", HouseInfo[playerid][hHouseOwnerId]);fwrite(hFile, var); format(var, 32, "HouseInterior=%d\n", HouseInfo[playerid][hHouseInterior]);fwrite(hFile, var); format(var, 32, "HouseId=%d\n", HouseInfo[playerid][hHouseId]);fwrite(hFile, var); format(var, 32, "Cost=%d\n", HouseInfo[playerid][hHouseCost]);fwrite(hFile, var); format(var, 32, "Locked=%d\n", HouseInfo[playerid][hHouseLocked]);fwrite(hFile, var); format(var, 32, "HouseX=%d\n", HouseInfo[playerid][hHousex]);fwrite(hFile, var); format(var, 32, "HouseY=%d\n", HouseInfo[playerid][hHousey]);fwrite(hFile, var); format(var, 32, "HouseZ=%d\n", HouseInfo[playerid][hHousez]);fwrite(hFile, var); format(var, 32, "HouseX=%d\n", HouseInfo[playerid][hHousex]);fwrite(hFile, var); fclose(hFile); }
Originally Posted by MadeMan
Does this file exist?
|
hFile = fopen(string, io_write);
hFile = fopen(string, io_append);
hFile = fopen(string, io_write);
Originally Posted by MadeMan
You have
pawn Код:
pawn Код:
|
format(string, sizeof(string), "%d.cer", houses + 1);
Originally Posted by MadeMan
pawn Код:
![]() |