Files

23 lines
758 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Darklord.js — setFlightCaps() (satır 3079)
[← Darklord.js](index.md) · [← Master](../../wiki.md)
```javascript
function setFlightCaps(player, allow, flying)
{
try { if (player.setAllowFlying) player.setAllowFlying(Boolean(allow)); } catch (e1) {}
try { if (player.setFlying) player.setFlying(Boolean(flying)); } catch (e2) {}
try { if (player.setCanFly) player.setCanFly(Boolean(allow)); } catch (e3) {}
try
{
var mc = mcPlayerOf(player);
var caps = dbFieldAny(mc, ["capabilities", "field_71075_bZ"]);
caps.allowFlying = Boolean(allow);
caps.isFlying = Boolean(flying);
dbCallAny(mc, ["sendPlayerAbilities", "func_71016_p"], []);
}
catch (e4) {}
}
```