Convert huge amount of MTA/SA-MP objects into another type

Veröffentlicht von Knogle am

Right now i finished the first version of my small and tiny offline object converter for SA:MP/MTA:SA, because our favourite map converter is dead.

The purpose of this program and tutorial is to create a simple object converter for myself but now i want to share it, maybe its useful for someone

Another reason is the huge amount of objects i want to convert and the conversion by using online converters takes a huge amount of time due to the upload/download speed of the client.Its meant to be a commandline tool because i love simple stuff and i love SSH/CMD so why not?

Most online converters were not able to convert more than 5000 objects because they stop working or you get some connection timeout because of the slow upload.

So i decided to create a small C based converter by using fscanf and sscanf to parse the values out of the input and convert it into the desired output.

My tool is available for Linux and Windows at the moment, a Mac OSX version is not planned.
Note! This program is in Beta state so it may contain bugs, please report them if you encounter any malfunction.

You can report bugs via E-Mail: or by replying in this topic.

I did not pay attention of efficieny because even with 100.000 objects in worst case, meaning MTA:SA to SA:MP the average time for a conversion is around 1.6 seconds.
The execution time of this program is O(3n) in best case and O(6n) in the worst case (MTA:SA (XML) to SA:MP CreateObject)

The goal is to support features like the conversion of Vehicles,Peds/Actors, Pickups and more, like the MapConverter Plugin you can find in here.

I also want to cover more types of objects.

And the most important reason: I dont want to spent all my time, uploading and converting it somewhere.

Usage of this tool is quite simple.

Let’s check the readme..


 Copyright (C) 2017 Fabian Druschke (Knogle)
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <
    Compiler settings:
    Linux: gcc simpleconverter.c
    Windows MinGW: gcc simpleconverter.c
    Linux: ./a.out
    Windows: a
    Output file output.txt will be written into the same directory.

Running it..

Filename is converter.exe and the parameter the input filename.

(You can also use a batch file to execute it)


Now you choose the input objecttype and the desired output.
Now the conversion is done! Simple, isnt it?



Now you are ready to use this tool.


I did not use any XML Parser because for this simple use, because it would be way to difficult in to implement it in C!

Input sample, MTA SA 1.0 map:

<object id="object (des_ebrigroad07) (1)" breakable="true" interior="0" alpha="255" model="16358" doublesided="false" scale="1" dimension="0" posX="-1135.2" posY="-866.29999" posZ="62.5" rotX="0" rotY="0" rotZ="314"></object>
        <object id="object (des_ebrigroad07) (2)" breakable="true" interior="0" alpha="255" model="16358" doublesided="false" scale="1" dimension="0" posX="-1135.3" posY="-866.20001" posZ="72.7" rotX="0" rotY="0" rotZ="313.995"></object>
        <object id="object (des_ebrigroad07) (3)" breakable="true" interior="0" alpha="255" model="16358" doublesided="false" scale="1" dimension="0" posX="-1140.6" posY="-871.40002" posZ="66.1" rotX="90" rotY="0" rotZ="313.995"></object>



And our PAWN SA-MP output.


CreateObject(16358,-1135.199951,-866.299988,62.500000,0.000000,0.000000,314.000000);// (des_ebrigroad07)
    CreateObject(16358,-1135.300049,-866.200012,72.699997,0.000000,0.000000,313.994995);// (des_ebrigroad07)
    CreateObject(16358,-1140.599976,-871.400024,66.099998,90.000000,0.000000,313.994995);// (des_ebrigroad07)



I hope its useful for someone, like written in the license I will publish updates weekly in this topic and refresh the github repository.


Source only:


Kategorien: Software

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.