Grievous Posted April 15, 2009 Share Posted April 15, 2009 I'm trying to create cars that spawn on the map. What lua file do I put the command in? How do I call up that command so the cars will spawn? I'm really lost on this, I have a basic server and have admin access but I don't know what to do next to have cars spawn. I think maybe I need to make a map file with the cars in it and load it as part of a resource. Is this right? Please help. Grievous Link to comment
lexagav[RUS] Posted April 15, 2009 Share Posted April 15, 2009 To spawn cars use syntax: vehicle = createVehicle ( int model, float x, float y, float z, float rx, float ry, float rz, string numberplate ) Link to comment
Gamesnert Posted April 15, 2009 Share Posted April 15, 2009 Here's the wiki page, if you need more info: http://development.mtasa.com/index.php? ... ateVehicle Link to comment
robhol Posted April 15, 2009 Share Posted April 15, 2009 For vehicles that are a "permanent" part of the server/gamemode/map/whatever, you should use vehicle tags in a map. More info about this can be found on the wiki, but the basic syntax is: <vehicle model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" color="" upgrades="" paintjob="" plate="" turretX="" turretY="" health="" sirens="" landingGearDown="" specialState="" locked="" interior="" dimension=""/> Link to comment
Grievous Posted April 15, 2009 Author Share Posted April 15, 2009 ... I created this map file to spawn a car in the police parking garage but it didn't create the car. I have it in a folder under resoucres along with a meta.xml and a script.lua file function joinHandler() local x = 1580.55 local y = -1634.46 local z = 14 spawnPlayer(source, x, y, z) setPlayerSkin(playerSource, 280) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to My Server", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) I get CJ but no car. Maybe I need more data in the map file? please help Link to comment
Gamesnert Posted April 16, 2009 Share Posted April 16, 2009 *HINT* Use the "Code" button to make some pieces a little easier to read. <meta> <info author="grievous" type="gamemode" name="police" description="Los Santos Police" /> <script src="script.lua" /> </meta> You're forgetting to do Link to comment
Recommended Posts