Bleidex Posted October 31, 2011 Share Posted October 31, 2011 Well i have some problems and i didn't think out how to fix them ;/ Keys won't get binded: function repair ( thePlayer ) playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( playerVehicle ) then setElementHealth ( playerVehicle, 999 ) else return end end addCommandHandler ( "repair", repair ) function nos ( thePlayer ) playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( playerVehicle ) then addVehicleUpgrade ( playerVehicle, 1010 ) else return end end addCommandHandler ( "nos", nos ) function bindKeys ( player, commandName ) bindKey ( player, "2", "down", repair ) bindKey ( player, "LMB", "down", nos ) end addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) Also. I mapped few cars and so on for my server. They are in .map file. And if I take any car and explode it, it won't respawn until I restart the map. How to make that they would respawn? Link to comment
Charlie_Jefferson Posted October 31, 2011 Share Posted October 31, 2011 (edited) function repair ( thePlayer ) playerVehicle = getPedOccupiedVehicle ( thePlayer ) if (playerVehicle) then fixVehicle ( playerVehicle ) else end end addCommandHandler ( "repair", repair ) function nos ( thePlayer ) if (playervehicle) then addVehicleUpgrade ( playerVehicle, 1010 ) else end end addCommandHandler ( "nos", nos ) function bindKeys ( thePlayer, commandName ) bindKey ( thePlayer, "2", "down", repair ) bindKey ( thePlayer, "mouse1", "down", nos ) end addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) The meta.xml should be as server-side, not client-side. Report back, tell me if it worked. Edited October 31, 2011 by Guest Link to comment
Bleidex Posted October 31, 2011 Author Share Posted October 31, 2011 function repair ( thePlayer ) playerVehicle = getPedOccupiedVehicle ( thePlayer ) if playerVehicle then fixVehicle ( playerVehicle ) else end end addCommandHandler ( "repair", repair ) function nos ( thePlayer ) if playervehicle then addVehicleUpgrade ( playerVehicle, 1010 ) else end end addCommandHandler ( "nos", nos ) function bindKeys ( thePlayer, commandName ) bindKey ( thePlayer, "2", "down", repair ) bindKey ( thePlayer, "mouse1", "down", nos ) end addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) The meta.xml should be as server-side, not client-side. Report back, tell me if it worked. Meta is server-sided, haven't tested this yet, but /repair and /nos worked fine before, just binds didn't. Link to comment
Charlie_Jefferson Posted October 31, 2011 Share Posted October 31, 2011 Also, to make them respawn, you gotta get the position of them and setVehicleRespawnPosition(https://wiki.multitheftauto.com/wiki/Set ... wnPosition) and then when they explode, respawnVehicle(https://wiki.multitheftauto.com/wiki/RespawnVehicle) and add an eventHandler for it("onVehicleExplode"). 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