جرب
local Timer = {}
addEventHandler( 'onMarkerHit', resourceRoot,
function( hitElement )
if ( getElementType( hitElement ) == 'player' ) and not ( isPedInVehicle( hitElement ) ) and ( getElementHealth( hitElement ) < 100 ) then
local TE = getPlayerTeam ( hitElement )
if getTeamName ( TE ) ~= "Medic" then
if getPlayerMoney(hitElement) >= 75 then
if not isTimer(Timer[hitElement]) then
Timer[hitElement] = setTimer (function()
local newHealth = getElementHealth( hitElement ) + 10
setElementHealth(hitElement , newHealth)
if ( newHealth == 100 ) then
killTimer(Timer[hitElement])
outputChatBox("انت الان سليم", hitElement, 0, 255, 0, true)
end
end,3000,0,hitElement)
end
else
outputChatBox("انت لا تملك المال", hitElement, 0, 255, 0, true)
end
end
end
end)