Here's an example :
local LastHandled = { }
function buyhealth ( thePlayer )
if not LastHandled [ thePlayer ] then
LastHandled [ thePlayer ] = { }
end
if LastHandled [ thePlayer ] == false then return outputChatBox('Please Wait 20 Sec!',thePlayer,255,0,0) end
local money = getPlayerMoney ( thePlayer )
if money >= 500 then
outputChatBox("Você comprou Vida por 500$",thePlayer, 255, 106, 106)
local thePlayerhealth = getElementHealth ( thePlayer )
setElementHealth ( thePlayer, 569 )
takePlayerMoney ( thePlayer, 500 )
else
outputChatBox("Não há dinheiro suficiente, necessário 500$",thePlayer, 139, 101, -- s8) -->
end
LastHandled [ thePlayer ] = false
setTimer ( function ( ) LastHandled [ thePlayer ] = true end,20000,1 )
end
addCommandHandler ( "vida", buyhealth )
This is for the health make it for anything you want .