Jump to content

RageMP Mapping


Spezi01

Recommended Posts

Hello everyone,

i was a huge fan of SA:MP and scripted some stuff and now i started scripting in Rage MP last week and already got some usable results.

Now i want to map some stuff and get it into my server, but i have some problems.

 

The first problem is to find the right mapping tool.

The Map Editor from notsosmart, which is downloadable here at RageMP is not working, probably because it is not compatible with the newest GTA V Update. 

After some googeling i got the Mapping Tool from CodeWalker and the one from Menyoo.

I startet with CodeWalker, which is a little bit complicated on first use, but i played a little bit with it and spawned some cars and saved the .ymap file, so that i can try to integrate it into my RageMP Server. 

My Problem is, i don't know how to integrate/convert the ymap file into my server. I googled for a solution and searched in the forum, but i couldn't find anything.

If someone would describe step by step how to do that, i would be very thankful.

 

The second mapping tool from Menyoo was easier to use and i spawnt some cars and saved the .xml file. I tried different xml to json converters from the internet and the one, which is downloadable at RageMP, and copied the JSON Files i got from the different Converters into my maps folder and my server says that the .json is loaded, but non of them worked. When i connect to my server and go to the position where i mapped the cars, the cars aren't there/didn't spawn.

If someone could explain how i get the XML from Menyoo into working JSON Files for RageMP, it would be great.

 

And lust but not least, i have question:

Which is the best way of spawning cars in RageMP, when i want to do some stuff with them, e.g. check if the player who wants to get in Vehicle XY is a cop and authorized to use the car.

 

 

Thank you very much!

Sorry for my bad english, i'm from Germany.

Edited by Spezi01
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hey :)

I try to write it in english, so everyone could understand me :)

Especially for cars,  i used some Clientside Javascript.

Here is my Example:
 

mp.vehicles.new(mp.game.joaat("neon"), new mp.Vector3(246.3203, -377.455, 44.65885),
    {
        heading: 20 ,
        numberPlate: "ADMIN 1",
        color: [[50, 3, 160], [50, 2, 144]]
    });

So nun auf Deutsch:

Extra für Autos die an einer bestimmten Stelle spawnen habe ich diesen Codeabschnitt verwendet. Kann dir gerne mal die komplette Datei schicken (mit Index) wenn du was brauchst :) Bin zwar Laie aber das hat mir zumindest geholfen nicht immer mit Befehlen zu hantieren (Adminbefehle und so :D)
Falls noch fragen offen sind kannst du mich gerne per PN anhauen @Spezi01 :P

Greets McWulf :)

 

PS: Hab auch mal in meiner Admindatei geschaut, Lösung zum Fahrzeugspawnen ist folgende, allerdings brauchst du eine entsprechend aktualisierte vehicleData.json und dieser Code ist in C# geschrieben.
 

[Command("auto", "~y~VERWENDUNG: ~w~/auto [Fahrzeugname] [Farbe 1] [Farbe 2] um ein Fahrzeug zu erstellen.")]
        public void CMD_SpawnCar(Client player, string vehName, int color1 = 1, int color2 = 1)
        {
               VehicleHash vehHash = NAPI.Util.VehicleNameToModel(vehName); 
               if (vehHash != 0)
               {
                      NAPI.Player.SetPlayerIntoVehicle(player, NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation, color1, color2), -1);
                      SendAdmMsg(player, "Du hast erfolgreich folgendes Fahrzeug erstellt : ~o~" + vehName.ToUpper());
                      return;
               } else
               {
                      NAPI.Chat.SendChatMessageToPlayer(player, "~r~FEHLER: ~w~Es gibt kein Fahrzeug mit folgendem Namen: ~o~" + vehName);
                      return;
               }
               else SendNoPermMsg(player);
        }

 

Edited by McWulf1991
Schreibfehler
Link to comment
Share on other sites

Hallo,

 

vielen Dank für die Antwort!

Mein Befehl zum Autos spawnen sieht so aus:

mp.events.addCommand('veh', (player, veh) => {
    if(!veh) return player.outputChatBox("Syntax: /veh [vehicle]");
    if(player.data.adminlevel >= 4)
    {
        pos = player.position;
        pos.x += 2;
        var NewVeh = mp.vehicles.new(veh, new mp.Vector3(pos)); 
        NewVeh.dimension = player.dimension
    }
    else
    {
        player.outputChatBox("Du bist kein Admin oder dein AdminLevel reicht nicht aus!")
    }
});

Wenn ich so aber ein Auto spawne ist das unkaputtbar, ich frage mich wieso.

Hast du oder sonst jemand eine Idee?

 

English:

The code shows my command for spawning a car, but the spawned car is not destroyable with guns.

Does anybody know why?

 

Thanks a lot!

 

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
Am 4.12.2018 um 17:44 schrieb Spezi01:

Hallo,

 

vielen Dank für die Antwort!

Mein Befehl zum Autos spawnen sieht so aus:


mp.events.addCommand('veh', (player, veh) => {
    if(!veh) return player.outputChatBox("Syntax: /veh [vehicle]");
    if(player.data.adminlevel >= 4)
    {
        pos = player.position;
        pos.x += 2;
        var NewVeh = mp.vehicles.new(veh, new mp.Vector3(pos)); 
        NewVeh.dimension = player.dimension
    }
    else
    {
        player.outputChatBox("Du bist kein Admin oder dein AdminLevel reicht nicht aus!")
    }
});

Wenn ich so aber ein Auto spawne ist das unkaputtbar, ich frage mich wieso.

Hast du oder sonst jemand eine Idee?

 

English:

The code shows my command for spawning a car, but the spawned car is not destroyable with guns.

Does anybody know why?

 

Thanks a lot!

 

Ganz einfach.

NewVeh.Invincible = false;

 

Gruß

Link to comment
Share on other sites

Am 25.1.2019 um 10:42 schrieb TobseN:

Ganz einfach.


NewVeh.Invincible = false;

 

Gruß

Hallo und erstmal vielen Dank für die Rückmeldung!

Das ganze sieht jetzt folgendermaßen bei mir aus:

 

mp.events.addCommand('veh', (player, veh) => {
    if(!veh) return player.outputChatBox("Syntax: /veh [vehicle]");
    if(player.data.adminlevel >= 4)
    {
        pos = player.position;
        pos.x += 2;
        var NewVeh = mp.vehicles.new(veh, new mp.Vector3(pos)); 
        NewVeh.dimension = player.dimension
        NewVeh.Invincible = false;            
    }
    else
    {
        player.outputChatBox("Du bist kein Admin oder dein AdminLevel reicht nicht aus!")
    }
});

Funktioniert aber leider nicht, hab mit nem Raketenwerfer drauf geschossen und nichts ist passiert.

 

Gruß

Link to comment
Share on other sites

vor 14 Stunden schrieb Spezi01:

Hallo und erstmal vielen Dank für die Rückmeldung!

Das ganze sieht jetzt folgendermaßen bei mir aus:

 


mp.events.addCommand('veh', (player, veh) => {
    if(!veh) return player.outputChatBox("Syntax: /veh [vehicle]");
    if(player.data.adminlevel >= 4)
    {
        pos = player.position;
        pos.x += 2;
        var NewVeh = mp.vehicles.new(veh, new mp.Vector3(pos)); 
        NewVeh.dimension = player.dimension
        NewVeh.Invincible = false;            
    }
    else
    {
        player.outputChatBox("Du bist kein Admin oder dein AdminLevel reicht nicht aus!")
    }
});

Funktioniert aber leider nicht, hab mit nem Raketenwerfer drauf geschossen und nichts ist passiert.

 

Gruß

Es kann sein das die Fahrzeuge immer unzerstörbar sind wenn niemand drinne ist.

Teste es mal indem du reingehst und versuchst es kaputt zu machen.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...