16.11.2013, 17:33
Код:
public LoadDynamicFactionDoors() { new rows, fields; new total = 0; cache_get_data(rows, fields); if(rows) { while(total < rows) { FactionDoors[total][dID] = cache_get_row_int(total, 0); FactionDoors[total][dFaction] = cache_get_row_int(total, 1); cache_get_row(total, 2, FactionDoors[total][dInfo], dbHandle, 128); FactionDoors[total][dEnterX] = cache_get_row_float(total, 3); FactionDoors[total][dEnterY] = cache_get_row_float(total, 4); FactionDoors[total][dEnterZ] = cache_get_row_float(total, 5); FactionDoors[total][dExitX] = cache_get_row_float(total, 6); FactionDoors[total][dExitY] = cache_get_row_float(total, 7); FactionDoors[total][dExitZ] = cache_get_row_float(total, 8); FactionDoors[total][dEnterInterior] = cache_get_row_int(total, 9); FactionDoors[total][dExitInterior] = cache_get_row_int(total, 10); FactionDoors[total][dVirtualWorld] = cache_get_row_int(total, 11); FactionDoors[total][dWithVehicle] = cache_get_row_int(total, 12); FactionDoors[total][dEnterAngle] = cache_get_row_float(total, 13); FactionDoors[total][dExitAngle] = cache_get_row_float(total, 14); FactionDoors[total][dDoorOn] = 1; FactionDoors[total][dLocked] = 1; FactionDoors[total][dPickUp] = CreateDynamicPickup(1239, 2, FactionDoors[total][dEnterX], FactionDoors[total][dEnterY], FactionDoors[total][dEnterZ], -1, -1, -1, 100.0); total++; } } format(msg,sizeof(msg), "Loaded %d faction doors from MySQL.", total); printf(msg); return 1; }