02.08.2017, 19:47
hello i have a house system that uses dini but when i try to create a house i cant create it. In scriptfiles folder i have my Houses folder but no file is getting created.
Код:
stock createhouseext(playerid)
{
new hs[20];
format(hs,sizeof(hs),"Houses/%d",housecount);
new Float:hpx,Float:hpy,Float:hpz;
GetPlayerPos(playerid,hpx,hpy,hpz);
new out=0;
dini_FloatSet(hs,"hexx",hpx);
dini_FloatSet(hs,"hexy",hpy);
dini_FloatSet(hs,"hexz",hpz);
dini_IntSet(hs,"hintid",GetPlayerInterior(playerid));
dini_IntSet(hs,"hintvir",housecount);
dini_IntSet(hs,"houtid",out);
dini_IntSet(hs,"houtvir",out);
dini_BoolSet(hs,"owned",false);
dini_BoolSet(hs,"rentable",false);
dini_BoolSet(hs,"locked",false);
dini_Set(hs,"owner","");
dini_Set(hs,"hkey","");
dini_IntSet(hs,"hprice",50000);
dini_IntSet(hs,"hrent",0);
dini_IntSet(hs,"hgun1",0);
dini_IntSet(hs,"hammo1",0);
dini_IntSet(hs,"hgun2",0);
dini_IntSet(hs,"hammo2",0);
dini_IntSet(hs,"hgun3",0);
dini_IntSet(hs,"hammo3",0);
housecount++;
return 1;
}
stock createhouseent(playerid)
{
new hc[20];
new hs[20];
if(housecount==0)
{
for(new m = 0; m < MHOUSE; m++)
{
format(hc,sizeof(hc),"Houses/%d",m);
if(!dini_Exists(hc))
{
housecount=m;
return 0;
}
}
}
else
{
format(hs,sizeof(hs),"Houses/%d",housecount);
dini_Create(hs);
new Float:hpx,Float:hpy,Float:hpz;
GetPlayerPos(playerid,hpx,hpy,hpz);
dini_FloatSet(hs,"henx",hpx);
dini_FloatSet(hs,"heny",hpy);
dini_FloatSet(hs,"henz",hpz);
return 1;
}
return 1;
}
CMD:createhouse(playerid)
{
createhouseent(playerid);
SCM(playerid,COLOR_GREY,"House Entrance Set. Use /gotoint to go to a house and use /finishhouse at the house");
return 1;
}
CMD:finishhouse(playerid)
{
createhouseext(playerid);
SCM(playerid,COLOR_GREY,"You Have Completed This House.");
return 1;
}

