Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dutils>
- public OnFilterScriptInit()
- {
- new File:temp = fopen("temp.txt"), string[1024], modelid, Float:x, Float:y, Float:z, Float:a, cor[2];
- new File:output = fopen("vehicles.sql"), i, index;
- while(fread(temp, string))
- {
- i++;
- new tmp[1024], model[256];
- strmid(model, string[strfind(string, "(", true)], 1, 5);
- modelid = strval(model);
- strtok(string, index, ',');
- x = floatstr(strtok(string, index, ','));
- y = floatstr(strtok(string, index, ','));
- z = floatstr(strtok(string, index, ','));
- a = floatstr(strtok(string, index, ','));
- cor[0] = strval(strtok(string, index, ','));
- cor[1] = strval(strtok(string, index, ','));
- index = 0;
- format(tmp, sizeof tmp, "INSERT INTO `cars` VALUES(%d, %d, '%.2f', '%.2f', '%.2f', '%.2f', %d, %d, \
- -1, 'default', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n", i, modelid, x, y, z, a,
- cor[0], cor[1]);
- fwrite(output, tmp);
- }
- fclose(output);
- fclose(temp);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment