Jump to content

[HELP] Freeze Vehicle


xXGhostXx

Recommended Posts

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
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
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

@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
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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