Notice: Failed to invoke Pygments: [Called from MediaWiki\SyntaxHighlight\SyntaxHighlight::highlightInner in /home/pi/www/gtac/wiki/wiki/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php at line 334] in /home/pi/www/gtac/wiki/wiki/includes/debug/MWDebug.php on line 507
Toggle Tyres Burst - GTA Connected

Toggle Tyres Burst

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)