Jump to content
  • 0

pomoc [HELP]dini


UpiR

Dotaz


public CrateHouse()
{
if(pocet < 10)
   {
new s2[100];
format(s2,100,"houses/house%d.txt",pocet);
dini_Create(s2);
dini_IntSet(s2,"Predaj",1);
dini_IntSet(s2,"Money",0);
dini_IntSet(s2,"Marihuana",0);
CrateHouse();
pocet ++;
}
return 1;
}

Ako vidite snažil som sa urobiť ciklus ktory vitvory 10house suborov

neviem prečo ale vitvori sa mi iba house1.. neviete čim to môže byť ?

a existuje cod na zatvorenie suboru ? (dini)

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0
public CrateHouse()
{
while (pocet < 10)
{
new s2[100];
format(s2,100,"houses/house%d.txt",pocet);
dini_Create(s2);
dini_IntSet(s2,"Predaj",1);
dini_IntSet(s2,"Money",0);
dini_IntSet(s2,"Marihuana",0);
pocet ++;
}
return 1;
}

Link to comment
Share on other sites

  • 0

while (xxx < 10)

{

xxx ++;

}

 

V preklade "ak xxx bude menší ako 10 pripočítaj k xxx + 1 (xxx ++)" a toto sa bude opakovať až kám xxx nebude 10, potom automaticky prestane.

 

Snád' si pochopil :d

Link to comment
Share on other sites

  • 0

neviem ale ja som to pochopil tak že bude sa to opakovať do vtedy až kym podmienka nebude platiť.. aj takto sa to da pochopiť nie ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...