Hallo zusammen,
Ich wollte grad einen Skript schreiben der eine Animation dem Spieler aufzwingt sobald er schwer verletzt ist.
Da es anscheindend keine Funktion fürs abfragen gibt wie viel Leben ein Spieler hat, habe ich es so versucht.
Lua
addEventHandler ( "onPlayerDamage", getRootElement (),
function()
local thePlayer = getAccountPlayer ( theAccount ) -- get the client attached to the account
if ( getElementType ( thePlayer ) == "player" ) then -- see if it really is a player (rather than a console admin for example)
if getElementHealth(source) < 5 then
setPedRotation(thePlayer, 315)
setPedAnimation( thePlayer, "ped", "CAR_crowloutRHS")
end
end
end)
Aber es kommen 2 Warnings.
WARNING: Bad argument @ 'getAccountPlayer' [Expected account at argument 1, got nil]
WARNING: Bad argument @ 'getElementTyp' [Expected element at argument 1, got boolean]
Nun meine Frage, wie kann ich das beheben? Es ist serverseitig eingetragen *such*
MFG MrGTAmodsgerman