31.08.2011, 16:50
Ok booked a lil bit more progress with the 2nd option:
OnGamemodeInIt:
That actually works and creates a checkpoint.
But I want to know why it works like that, and not like this:
Is there something wrong? Or is it right and could it be that somehow the enum isn't right?
also could somebody give me a little bit explanation at things like:
which I believe is the same as Loop(i, MAX_PLAYERS) with this on the top of my script:
and why sometimes this doesn't work:
And this does:
OnGamemodeInIt:
Код:
//Loading houses from database
new mysql_connection;
mysql_connection = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
mysql_query("SELECT * FROM `houses` WHERE `id` < "#MAX_HOUSES);
mysql_store_result(mysql_connection);
new n;
while (mysql_retrieve_row())
{
new tmp[32];
new id;
GET_INT(id, "id");//Loads houseid
GET_INT(Houses[id][House_Price], "price");
GET_INT(Houses[id][House_Interior], "interior");
GET_STR(Houses[id][HouseOwner], "owner");
new Float:x, Float:y, Float:z;
GET_FLOAT(x, "x");
GET_FLOAT(y, "y");
GET_FLOAT(z, "z");
Houses[id][hX] = x;
Houses[id][hY] = y;
Houses[id][hZ] = z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
HouseCPOut[i] = CreateDynamicCP(x, y, z, 1.5, 0, 0, -1, 5.0);
}
SpawnHouse();
n++;
}
But I want to know why it works like that, and not like this:
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
HouseCPOut[i] = CreateDynamicCPHouses[id][hX],Houses[id][hY],Houses[id][hZ], 1.5, 0, 0, -1, 5.0);
}
also could somebody give me a little bit explanation at things like:
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Код:
#define Loop(%0,%1) for(new %0 = 0; %0 < %1; %0++)
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Код:
new i; for(i = 0; i < MAX_PLAYERS; i++)

