Won't work either.
This one works:
local LastHandled = { }
function buyhealth ( thePlayer )
if ( LastHandled [ thePlayer ] == nil ) 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, 8 )
end
LastHandled [ thePlayer ] = false
setTimer (
function ( )
LastHandled [ thePlayer ] = true
end
,20000, 1
)
end
addCommandHandler ( "vida", buyhealth )