Files

38 lines
1.8 KiB
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.
# ezoic_radyasyon.js — mermi_dondurma() (satır 285)
[← ezoic_radyasyon.js](index.md) · [← Master](../../wiki.md)
Parça 1/2 · [sonraki](mermi_dondurma-2.md)
```javascript
function mermi_dondurma(c) {
var player = c.getSubject();
if (!checkPermission(player)) return;
if (player.getStates().has("MermiDondurma")) {
player.getStates().remove("MermiDondurma");
player.send("§cMermi Dondurma Deaktif Edildi.");
} else {
player.getStates().setNumber("MermiDondurma", 1);
player.send("§aMermi Dondurma Aktif Edildi!");
function freezeLoop(context) {
if (!player.getStates().has("MermiDondurma")) return;
var pos = player.getPosition();
var entities = c.getServer().getEntities("@e");
for each (var e in entities) {
try {
var className = e.getMinecraftEntity().getClass().getSimpleName().toLowerCase();
var isProj = className.indexOf("arrow") !== -1 ||
className.indexOf("fireball") !== -1 ||
className.indexOf("snowball") !== -1 ||
className.indexOf("potion") !== -1 ||
className.indexOf("bullet") !== -1 ||
className.indexOf("spit") !== -1 ||
className.indexOf("trident") !== -1;
if (isProj) {
var ePos = e.getPosition();
var dist = Math.sqrt(Math.pow(pos.x-ePos.x,2) + Math.pow(pos.y-ePos.y,2) + Math.pow(pos.z-ePos.z,2));
if (dist <= Config.FreezeRadius) {
var data = e.getFullData();
```