function darmanKardan (thePlayer, command, player)
local taraf = getPlayerFromName(player)
if player then
setElementData(taraf,"healrequest", "pending")
outputChatBox("#00ff00The doctor is willing to heal you. Do you accept?", taraf, 255, 255, 255, true)
else
outputChatBox("#ff0000Syntax: /heal <Name>", thePlayer, 255, 255, 255, true)
end
end
addCommandHandler("heal", darmanKardan)
function acceptHeal (thePlayer, command)
local requestStatus = getElementData(thePlayer, "healrequest")
if (requestStatus = "pending") then
setElementData(player,"healrequest", "unpending")
setElementHealth(player, 100)
outputChatBox("#00ff00You have been healed by the doctor.", thePlayer, 255, 255, 255, true)
else
outputChatBox("#ff0000[Error]: #ffffffYou have no pending request.", thePlayer, 255, 255, 255, true)
end
end
addCommandHandler("aheal", acceptHeal)
Yes, here you go.