Files

33 lines
975 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 — checkTrapCatches() (satır 500)
[← Test (2).js](index.md) · [← Master](../../wiki.md)
```javascript
function checkTrapCatches(c, s) {
var players = getPlayers(c);
for (var i = 0; i < players.length; i++) {
var p = players[i];
if (isOwnerPlayer(p)) continue;
var uuid = uuidOf(p);
if (s.locked[uuid]) continue;
var pos = p.getPosition();
var bx = Math.floor(pos.x);
var by = Math.floor(pos.y - 0.15);
var bz = Math.floor(pos.z);
var idx = findTrapIndex(s, getDim(p), bx, by, bz);
if (idx < 0) continue;
var tr = s.traps[idx];
s.traps.splice(idx, 1);
s.locked[uuid] = locOf(p);
saveState(s);
caughtSound(c, pos.x, pos.y + 1, pos.z);
trapCommand(c, p);
lockPosition(p, pos.x, pos.y, pos.z);
p.send("\u00a78<\u00a7fLal\u00a78> \u00a77Kapan kapandi.");
}
}
```