711 B
711 B
Test (2).js — kaldir() (satır 239)
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.");
}