Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define NOMBRE_DEL_MAPA "Mapa"
- #define EXTENSION ".pwn"
- // Precisión usada en las coordenadas del mapa a exportar
- #define PRECISION "2"
- #include <a_samp>
- // Librería YSI - https://github.com/Misiur/YSI-Includes/archive/YSI.tl.zip
- // Dependencias (amx_assembly - carpeta "amx") - https://github.com/Zeex/amx_assembly/archive/master.zip
- #include <YSI_Data\y_iterate>
- // Límite de objetos
- #undef MAX_OBJECTS
- #define MAX_OBJECTS 15000
- enum objects@data
- {
- ModelID,
- Float:X,
- Float:Y,
- Float:Z,
- Float:RX,
- Float:RY,
- Float:RZ,
- }
- new OBJECTS_DATA[MAX_OBJECTS][objects@data];
- new Iterator:ClonedObject<MAX_OBJECTS>;
- new File:MAP;
- clone_CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- static current_object@id = -1;
- current_object@id ++;
- OBJECTS_DATA[current_object@id][ModelID] = modelid;
- OBJECTS_DATA[current_object@id][X] = x;
- OBJECTS_DATA[current_object@id][Y] = y;
- OBJECTS_DATA[current_object@id][Z] = z;
- OBJECTS_DATA[current_object@id][RX] = rx;
- OBJECTS_DATA[current_object@id][RY] = ry;
- OBJECTS_DATA[current_object@id][RZ] = rz;
- Iter_Add(ClonedObject, current_object@id);
- return true;
- }
- #if defined _ALS_CreateDynamicObject
- #undef CreateDynamicObject
- #else
- #define _ALS_CreateDynamicObject
- #endif
- #define CreateDynamicObject clone_CreateDynamicObject
- public OnFilterScriptInit()
- {
- Iter_Clear(ClonedObject);
- // Tus objetos van aquí;
- CreateDynamicObject(2000, 1178.56995, -1323.48999, 14.13000, 90.00000, 90.00000, 0.00000);
- // - - - - - -
- // Nunca después de esta función:
- FixObjectsPrecision();
- }
- FixObjectsPrecision()
- {
- MAP = fopen(""NOMBRE_DEL_MAPA""EXTENSION"");
- new current_object@str[256];
- foreach(new co@id : ClonedObject)
- {
- //new tmp = (co@id - 1);
- format(
- current_object@str,
- sizeof(current_object@str),
- "CreateDynamicObject(%d, %0."PRECISION"f, %0."PRECISION"f, %0."PRECISION"f, %0."PRECISION"f, %0."PRECISION"f, %0."PRECISION"f);",
- OBJECTS_DATA[co@id][ModelID],
- OBJECTS_DATA[co@id][X],
- OBJECTS_DATA[co@id][Y],
- OBJECTS_DATA[co@id][Z],
- OBJECTS_DATA[co@id][RX],
- OBJECTS_DATA[co@id][RY],
- OBJECTS_DATA[co@id][RZ]
- );
- strcat(current_object@str, "\r\n");
- fwrite(MAP, current_object@str);
- }
- fclose(MAP);
- printf(""NOMBRE_DEL_MAPA""EXTENSION" exportado. (%d objetos arreglados)", Iter_Count(ClonedObject));
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement