PHP Code:
/*
Script for Emera by Astram
Note: Same formula can apply for stealth using player.alpha
Saying /big will toggle the zoom for everyone, and when someone logs on the server
they will be updated to see big people
*/
function onActionServerSide() {
this.canuse = {"Manager", "Owner", "Co-Owner"};
if (params[0] == "ZoomCheck") {
for (temp.p : allplayers) {
if (p.zoom == 2) {
triggerclient( "gui", this.name, "Zoom", 2, p);
}
}
}
if (params[0] == "Zoom" && player.guild in this.canuse) {
if (params[1] == "Big") {
for (temp.p : allplayers) {
p.triggerclient( "gui", this.name, "Zoom", 2, player);
}
}
if (params[1] == "Normal") {
for (temp.p : allplayers) {
p.triggerclient( "gui", this.name, "Zoom", 1, player);
}
}
}
}
//#CLIENTSIDE
function onCreated() {
triggerserver( "gui", this.name, "ZoomCheck");
}
function onPlayerChats() {
if (player.chat == "/big") {
if (player.zoom != 2) {
triggerserver( "gui", this.name, "Zoom", "Big");
} else {
triggerserver( "gui", this.name, "Zoom", "Normal");
}
}
}
function onActionClientSide() {
if (params[0] == "Zoom") {
findplayer(params[2]).zoom = params[1];
}
}