Files

29 lines
711 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.
# Test (2).js — kaldir() (satır 239)
[← Test (2).js](index.md) · [← Master](../../wiki.md)
```javascript
function kaldir(c) {
var p = c.getSubject();
if (!isOwnerPlayer(p)) return;
var hit = getLookBlock(p, TRAP_RANGE + 1);
if (!hit) {
p.send("\u00a7cBaktigin yerde blok yok.");
return;
}
var s = loadState();
var idx = findTrapIndex(s, hit.dim, hit.x, hit.y, hit.z);
if (idx < 0) {
p.send("\u00a7eBaktigin blokta tuzak yok.");
return;
}
s.traps.splice(idx, 1);
saveState(s);
removeSound(c, hit.x + 0.5, hit.y + 0.65, hit.z + 0.5);
p.send("\u00a77Baktigin tuzak kaldirildi.");
}
```