Minta:CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0);
#include <a_samp>#define OBJECT_FAJL \"Objectek.txt\" // Innen fogja kiolvasni az értékeketpublic OnFilterScriptInit(){ ObjectBetoltes(); return 1;}stock ObjectBetoltes(){ new File:fajl = fopen(OBJECT_FAJL, io_read); new data[128]; new Float:Pos[3], Float:Rot[3]; new model, world = -1, interior = -1, player = -1, Float:streamdist = 200.0, betoltott; while(fread(fajl, data)) { sscanf(data, \"p<,>dffffffdddf\", model, Pos[0], Pos[1], Pos[2], Rot[0], Rot[1], Rot[2], world, interior, player, streamdist); CreateDynamicObject(model, Pos[0], Pos[1], Pos[2], Rot[0], Rot[1], Rot[2], world, interior, player, streamdist); betoltott ++; } return betoltott; // Visszatérési érték: Betöltött objectek száma}
#include <a_samp>#include <sscanf2>#include <streamer>publicOnFilterScriptInit(){ObjectLoad(\"object.txt\");return 1;}stockObjectLoad(file[]){newO_line,O_start = -1,O_end,O_temp[256],File:O_object,O_modelid = INVALID_OBJECT_ID,Float:O_x,Float:O_y,Float:O_z,Float:O_rx,Float:O_ry,Float:O_rz,O_worldid = -1,O_interiorid = -1,O_playerid = -1,Float:O_streamdistance = 200.0;print(\"\\n\\n\\nObject Loader loaded\");O_object = fopen(file, io_read);if(O_object){while(fread(O_object, O_temp)){ O_line++; if(sscanf(O_temp, \"p<,>dffffffD(-1)D(-1)D(-1)F(200.0)\", O_modelid, O_x, O_y, O_z, O_rx, O_ry, O_rz, O_worldid, O_interiorid, O_playerid, O_streamdistance)) printf(\"Error, loaded line: %d->%s\", O_line, O_temp); else { if(O_modelid != INVALID_OBJECT_ID) { O_end = CreateDynamicObject(O_modelid, O_x, O_y, O_z, O_rx, O_ry, O_rz, O_worldid, O_interiorid, O_playerid, O_streamdistance); // printf(\"Loaded: %d,%f,%f,%f,%f,%f,%f,%d,%d,%d,%f\", O_modelid, O_x, O_y, O_z, O_rx, O_ry, O_rz, O_worldid, O_interiorid, O_playerid, O_streamdistance); O_modelid = INVALID_OBJECT_ID; } if(O_start == -1) { O_start = O_end; } }}printf(\"Loaded object : %d items\\n\\n\\n\", O_end - O_start + 1);fclose(O_object);} else printf(\"A fájlt nem sikerült megnyítni: %s\", file);}