Quest Posted January 8, 2008 Share Posted January 8, 2008 Hello Scripting Community! I am an experianced scripter for SA-MP, and I am very glad and excited about MTA. Anyway-- I have read through many of the forums and questions out there but I have 2 of my own. 1) Car Spawns: I am using my old Coordinates from SAMP (which is difficult to transfer because I am missing RotX and RotY). I was wondering if there is a way to store the spawned vehicles locations. Perhaps if I spawned and populated my map with the admin vehicle spawner is there a way to save all the vehicles locations? Or will I have to wait for the map editor? 2) Are there Player animations, such as wave, dancing, etc ? I am not a Role Player, but it is fun to wave to someone or give them the finger. I THINK there aren't any yet but are probably in the works and this is just a stupid question. I just realized one more question that I am sure that has been answered a few times but I haven't seen: Is there a way to replace CJ's voice with the pedestrian skins sounds? It is odd to have a woman in a bikini go 'Oh Shit!' in CJ's voice. I know my questions are trivial and I am sure they have been answered, but thank you for reading and replying. -[W]Quest Link to comment
[email protected] Posted January 8, 2008 Share Posted January 8, 2008 I cannot answer question 2, but in response to qyestion 1: I think you can do this like this: -create an empty map using the fast tutorial on the scripting wiki. -this is a .map file with an internal XML structure. -load this mapfile into your script, and find the correct XML node (the parent node for the nodes, which is the map-node I think, but I haven't check that currently). -Then simply for every vehicle create new vehicle-nodes in the XML structure, and when you are done save the XML tree back to the file. I had some difficulty by figuring out the details on the way MTA handles this, but there is a set of basic operations (like xmlCreateNode or whatever), you can look that up in the scripting wiki again. Link to comment
Guest Posted January 8, 2008 Share Posted January 8, 2008 1) Here: it was on the same page you posted your topic.... viewtopic.php?f=91&t=21149 Link to comment
Quest Posted January 8, 2008 Author Share Posted January 8, 2008 I do not just want a converter tho, since the MTA engine can host way more cars then the SAMP one... so I would prefer not to load SAMP and try to spawn way more vehicles. But thank you for that link, that will be useful! Link to comment
Guest Posted January 9, 2008 Share Posted January 9, 2008 No problem, and also if you wanted a way to save your vehicles you would probably have to script a way. I mean you could get all the vehicles, save the positions to a text/map file and all is done and then just put them in your map. Link to comment
Quest Posted January 9, 2008 Author Share Posted January 9, 2008 That's my new plan! Thanks for the help and advice. Anyone know about the Player animations or voice? Link to comment
[email protected] Posted January 9, 2008 Share Posted January 9, 2008 I scripted my own vehicle-saving script, but it's very userunfriendly if you aren't used to it a lot... What it mainly gives you is 2 commands: 1 is to save an individual vehicle's respawn location, another is to save the total map to your disk. It's very sloppy coded, and doesn't take performance in mind or whatso-ever (it removes all vehicle nodes from your map-file and updates it with the ones that were there + new cars spawned on the map). This is mainly because I am lazy and it's meant for developing only, not for production servers. It works nicely for me, it has the following benefits: -Vehicle spawns can be added, removed (by destroying the vehicle element), updated and saved to the disk, all in-game -It has no GUI, but it's fairly simple to use: Spawn a car using the admin panel (or any other method), drive the car to the positon you want it to spawn at and make sure it's rotated to the way you want it, then use the save car command in-game. Your car is saved in the server memory then, not your disk. Do this for all cars you want to add/update. When you are down use the command to save the map, and your mapfile is updated , just restart the admin resource and your gamemode/map that is running on your server and it's ready for use. -Disadvantages: -no GUI -poorly coded, but it does it's job -the code is basicaly untested for specific scenario's, always make a backup of your mapfile before attempting things with this, for safety. -no documentation -can only edit vehicles in mapfiles, or files having an XML structure that matches the basic mapfile structure. I will upload this somewhere tomorrow or the day after, because the code is currently hardcoded for 1 specific map, and 1 specific game-mode. I will change this so you can set your own mapfile, easily and remove some stuff that is absolutely useless for this purpose Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now