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
Heal and Fix Command in one - GTA Connected

Heal and Fix Command in one

Revision as of 21:02, 14 August 2018 by Mex (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This code sets the player's health and armour to 100, and their vehicle health to 1000 and components fixed, when the player types either /heal or /fix.

Code

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

local function healandfix(cmd, args)
	if localPlayer.vehicle then
		localPlayer.vehicle.health = 1000
		localPlayer.vehicle:fix()
	end
	localPlayer.health = 100
	localPlayer.armour = 100
end
addCommandHandler('heal', healandfix)
addCommandHandler('fix', healandfix)