ScriptingExamples/ToggleTyresBurst: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
 
(No difference)

Latest revision as of 14:48, 14 August 2018

Description

This code allows anyone who types the command /tyres whilst in a vehicle, to have all their vehicle's tyres toggled between burst and inflated.

Code

Lua, Client-Side, GTAC versions 1.0.72 and newer:

addCommandHandler("tyres",function(commandName,arguments)
	if not localPlayer.vehicle then return end
	local popped = localPlayer.vehicle:getWheelStatus(0) ~= 1
	local status = popped and 1 or 3
	for wheel=0,3,1 do
		localPlayer.vehicle:setWheelStatus(wheel, status)
	end
end)