#define hPATH "/HousesDB/%s.ini"
#define MAX_HOUSES 30
enum hInfo
{
Text3D:hText,
Owner[MAX_PLAYER_NAME],
DefaultPrice,
SellPrice,
Interior,
hSell,
hPickup,
Float:EnterPos[3],
Float:TelePos[3]
}
new HouseInfo[MAX_HOUSES][hInfo];
stock HousesDB(houseid)
{
new string[256];
format(string,sizeof(string),hPATH,HouseInfo[houseid][Owner]);
return string;
}
forward LoadHouse_Data(houseid,name[],value[]);
public LoadHouse_Data(houseid,name[],value[])
{
INI_String("Owner",HouseInfo[houseid][Owner],24);
INI_Int("SellPrice",HouseInfo[houseid][SellPrice]);
INI_Int("Interior",HouseInfo[houseid][Interior]);
return 1;
}
stock CreateHouse(Price,Float:EnterX,Float:EnterY,Float:EnterZ,Layout,TeleX,TeleY,TeleZ)
{
HouseInfo[houseid][DefaulPrice] = Price;
HouseInfo[houseid][EnterPos][0] = EnterX;
HouseInfo[houseid][EnterPos][1] = EnterY;
HouseInfo[houseid][EnterPos][2] = EnterZ;
HouseInfo[houseid][Interior] = Layout;
HouseInfo[houseid][TelePos][0] = TeleX;
HouseInfo[hosueid][TelePos][1] = TeleY;
HouseInfo[houseid][TelePos][2] = TeleZ;
HouseInfo[houseid][hPickup] = CreatePickup(1273,1,EnterX,EnterY,EnterZ,0);
HouseInfo[houseid][hSell]=0;
new sttring[250];
if(!HouseInfo[houseid][Owner][0]) format(string,sizeof(string),"{FOR SELL}\nPrice:%d",DefaultPrice);
else if(HouseInfo[houseid][Owner][0] != 0)
{
if(HouseInfo[houseid][hSell]==0) format(string,sizeof(string),"Owner:%s",HouseInfo[houseid][Owner]);
else if(HouseInfo[houseid][hSell]==1) format(string,sizeof(string),"{FOR SELL}\nOwner:%s\nSell price:%d",HouseInfo[houseid][Owner],HouseInfo[houseid][SellPrice]);
}
HounseInfo[houseid][hText] = Create3DTextLabel(string,COLOR_DARKOLIVEGREEN,EnterX,EnterY,EnterZ+0.5,50.0);
houseid++;
return 1;
}
CreateHouse(5000,221.6365,114.6479,999.0156,5,1267.663208,-781.323242,1091.906250);//ERROR:invalid function or declaration+symbol already defined
CreateHouse(5000,221.6365,114.6479,999.0156,5,1267.663208,-781.323242,1091.906250);//ERROR:invalid function or declaration+symbol already defined
public OnGamemodeInit CreateHouse(5000,221.6365,114.6479,999.0156,5,1267 .663208,-781.323242,1091.906250); |
Why are u trying to put that in gm?
You need to create house from server and it will save to HouseDB.. And where do u wanna put this Код:
CreateHouse(5000,221.6365,114.6479,999.0156,5,1267.663208,-781.323242,1091.906250);//ERROR:invalid function or declaration+symbol already defined |
You are wrong, every house system is different.
CJGogo try to put it in OnGameModeInit or if not create a file in scriptfiles and put all your houses in file there and link it back to your script. You will have to change your script tho to make it work. |