Files

840 B
Raw Permalink Blame History

Test (2).js — kur() (satır 208)

← Test (2).js · ← Master

function kur(c) {
    var p = c.getSubject();
    if (!isOwnerPlayer(p)) return;

    startLoop(c);

    var hit = getLookBlock(p, TRAP_RANGE);
    if (!hit) {
        p.send("\u00a7cBaktigin yerde uygun blok yok.");
        return;
    }

    var s = loadState();
    if (findTrapIndex(s, hit.dim, hit.x, hit.y, hit.z) >= 0) {
        p.send("\u00a7eBu blokta zaten tuzak var.");
        return;
    }

    s.traps.push({
        dim: hit.dim,
        x: hit.x,
        y: hit.y,
        z: hit.z,
        publicUntil: nowMs() + 5000
    });
    saveState(s);

    announceTrap(c, hit.x + 0.5, hit.y + 0.65, hit.z + 0.5);
    p.send("\u00a77Tuzak baktigin blogun ustune kuruldu.");
}