stock GetHouses()
{
new file[60];
for(new i = 1; i < sizeof(HouseInfo) ; i++)
{
format(file,sizeof(file), "Houses/%i.ini",i);
if(!DOF2_FileExists(file)) return i;
}
return -1;
}
stock GetHouses()
{
new file[60];
for(new i = 1; i < sizeof(HouseInfo) ; i++)
{
format(file,sizeof(file), "Houses/%i.ini",i);
if(!DOF2_FileExists(file)) return i;
}
return -1;
}
estб funзгo
PHP код:
Poste o carregamento das casas! |
stock LoadHouses()
{
new id = GetHouses();
for(new i = 1; i < id; i++)
{
new file[80];
format(file, sizeof(file), Houses, i);
if(DOF2_FileExists(file))
format(HouseInfo[i][Owner], 200, "%s", DOF2_GetString(file, "Owner"));
format(HouseInfo[i][Adress], 200, "%s", DOF2_GetString(file, "Adress"));
HouseInfo[i][Owned] = DOF2_GetInt(file, "Owned");
HouseInfo[i][Price] = DOF2_GetInt(file, "Price");
HouseInfo[i][EnterX] = DOF2_GetFloat(file, "EnterX");
HouseInfo[i][EnterY] = DOF2_GetFloat(file, "EnterY");
HouseInfo[i][EnterZ] = DOF2_GetFloat(file, "EnterZ");
HouseInfo[i][EnterA] = DOF2_GetFloat(file, "EnterA");
HouseInfo[i][ExitX] = DOF2_GetFloat(file, "ExitX");
HouseInfo[i][ExitY] = DOF2_GetFloat(file, "ExitY");
HouseInfo[i][ExitZ] = DOF2_GetFloat(file, "ExitZ");
HouseInfo[i][ExitA] = DOF2_GetFloat(file, "ExitA");
HouseInfo[i][EnterInt] = DOF2_GetInt(file, "EnterInt");
HouseInfo[i][EnterVW] = DOF2_GetInt(file, "EnterVW");
HouseInfo[i][ExitInt] = DOF2_GetInt(file, "ExitInt");
HouseInfo[i][ExitVW] = DOF2_GetInt(file, "ExitVW");
HouseInfo[i][Locked] = DOF2_GetInt(file, "Locked");
if(HouseInfo[i][Owned])
{
HouseInfo[i][PickupID] = CreatePickup(1272, 1, HouseInfo[i][ExitX], HouseInfo[i][ExitY], HouseInfo[i][ExitZ], 0);
HouseInfo[i][Owned] = 1;
}
else
{
HouseInfo[i][PickupID] = CreatePickup(1273, 1, HouseInfo[i][ExitX], HouseInfo[i][ExitY], HouseInfo[i][ExitZ], 0);
HouseInfo[i][Owned] = 0;
}
}
printf("Fort Carson Roleplay - Casas Carregadas %d", id);
return 1;
}
stock GetHouses()
{
new
file[60], houses;
for(new i = 1; i <= sizeof(HouseInfo) ; i++)
{
format(file,sizeof(file), "Houses/%i.ini",i);
if(DOF2_FileExists(file))houses++;
}
return houses;
}
PHP код:
|
if(!DOF2_FileExists(file))
if(DOF2_FileExists(file))