Hallo hier ist ein Script das leider nicht funktionier könnte das jemand überarbeiten?
Lua
function heal(player, cmd, target)
local target = getPlayerFromName(target)
if target then
if ismedic(player) then
if getElementData( player, "heal") == true then
setElementData (player, "heal", false)
setElementData (target, "healVon", getPlayerName (player))
setTimer( resetheal, 300000, 1, player)
outputChatBox ( "Tippe /acceptheal um dies zu akzeptieren!", target, 225, 0, 0 )
end
end
end
end
addCommandHandler("heal", heal)
function acceptheals (player)
local Medic = getElementData (player, "healVon" )
if ( Medic ~= false ) and ( Medic ~= 0 ) then
local Medics = getPlayerFromName ( Medic )
if ( Medics ) then
takePlayerMoney ( player, 100 )
givePlayerMoney ( Medics, 100 )
setElementHealth(player, 100)
outputChatBox ( "" .. getPlayerName (player) .. " hat den Heal bezahlt!", Medics, 255, 0, 0 )
outputChatBox ( "[Angenommen] Heal von erfolgreich bezahlt!", player, 0, 255, 0 )
setElementData (player, "healVon", 0 )
end
end
end
addCommandHandler ( "acceptheal", acceptheals)
function resetheal ( player)
if getElementData( player, "heal" ) == false then
setElementData( player, "heal", true)
ouputChatBox("Du kannst wieder heilen", player)
end
end
Alles anzeigen