06.08.2013, 16:46
Okay today i was trying to get the loading of the clubs done but for some reason it makes the
bug happen. and also server crashes afterwards. this is the code:
That was the loading function placed under onGameModeInit
Now the part where it all gets loaded:
What is wrong in this code that it can trigger such a big bug
Код:
KICKING X Because they didnt log on to the game.
pawn Код:
mysql_function_query(Handle, "SELECT * FROM Clubs", true, "LoadClubs", "");
Now the part where it all gets loaded:
pawn Код:
forward LoadClubs();
public LoadClubs()
{
new rows, fields, i=0;
cache_get_data( rows, fields, Handle);
if(!rows)
{
print("Clubs table is empty, no results found.");
return 1;
}
while(rows > i < MAX_CLUBS)
{
AClubData[i][ID] = cache_get_row_int(i, 0);
cache_get_row(i, 2, AClubData[i][Owner], Handle, 24);
AClubData[i][ClubX] = cache_get_row_float(i, 21);
AClubData[i][ClubY] = cache_get_row_float(i, 22);
AClubData[i][ClubZ] = cache_get_row_float(i, 23);
AClubData[i][PickUpID] = CreateDynamicPickup(1273, 1, AClubData[i][ClubX], AClubData[i][ClubY], AClubData[i][ClubZ], -1);
}
return 1;
}