xXGhostXx Posted October 6, 2018 Share Posted October 6, 2018 Hi All Please give me functions for freeze vehicle ! Link to comment
Dimos7 Posted October 6, 2018 Share Posted October 6, 2018 setElementFrozen isElementFrozen Link to comment
xXGhostXx Posted October 6, 2018 Author Share Posted October 6, 2018 Just now, Dimos7 said: setElementFrozen isElementFrozen How to add distance for example : Syntax: /freezecar <Distance> or /freezecar 100 Freezed vehicle up to 100 meters distance ? 19 minutes ago, Dimos7 said: setElementFrozen isElementFrozen function freezeAllVeh ( thePlayer, cmd ) local playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) local currentFreezeStatus = isElementFrozen ( playerVehicle ) for index, AllPlayers in ipairs(getElementsByType("player")) do if getPedOccupiedVehicle ( thePlayer ) then setElementFrozen ( AllPlayers, playerVehicle, true ) end end end addCommandHandler("fcarall", freezeAllVeh) What is problem ? I want freeze all vehicle ! Link to comment
Dimos7 Posted October 6, 2018 Share Posted October 6, 2018 (edited) getDistanceBetweenPoints3D or getDistanceBetweenPoints2D Edited October 6, 2018 by Dimos7 Link to comment
xXGhostXx Posted October 6, 2018 Author Share Posted October 6, 2018 42 minutes ago, xXGhostXx said: How to add distance for example : Syntax: /freezecar <Distance> or /freezecar 100 Freezed vehicle up to 100 meters distance ? function freezeAllVeh ( thePlayer, cmd ) local playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) local currentFreezeStatus = isElementFrozen ( playerVehicle ) for index, AllPlayers in ipairs(getElementsByType("player")) do if getPedOccupiedVehicle ( thePlayer ) then setElementFrozen ( AllPlayers, playerVehicle, true ) end end end addCommandHandler("fcarall", freezeAllVeh) What is problem ? I want freeze all vehicle ! Please answer me ! @Dimos7 Link to comment
xXGhostXx Posted October 6, 2018 Author Share Posted October 6, 2018 1 hour ago, Dimos7 said: already did Please Fix Link to comment
Dimos7 Posted October 6, 2018 Share Posted October 6, 2018 function freezeAllVehs(thePlayer, cmd) for _, vehicle in pairs(getElementsByType("vehicle")) do local currentFreezeStatus = isElementFrozen(vehicle) setElementFrozen(vehicle, not currentFreezeStatus) end end addCommandHandler("fcarall", freezeAllVehs) try this should freeze and unfreeze all vehicles Link to comment
MTA Anti-Cheat Team Dutchman101 Posted October 6, 2018 MTA Anti-Cheat Team Share Posted October 6, 2018 @xXGhostXx, I would like to remind you of the scripting section guidelines, particularly; Quote The Scripting section is not meant for those unwilling to learn, whose only intent is to try get others to finish the scripts they need, line by line. We see this happening way too often - someone with seemingly zero scripting skills does not react on-topic to the set of functions they can use that other users provide them, and does not seem to take any pushes in the right direction forward; they are just waiting for a collective effort from other scripters to develop what they want. This is what we do not want to see. Do not expect all the work to be done for you while you lean back. We tend to motivate you to raise up and at least try to script it by yourself, and the users on the Scripting board are generally happy to aid in every particular issue you come across while coding it. If you still try to let others move the work for you (almost) completely, do not be surprised when you are not getting that much of help from others. Because we've seen this happening with several recent topics you made, please be aware that any repeating will result in a topic lock. I will lock this first to set an example. Link to comment
Recommended Posts