summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/app.js b/app.js
index 193a4f8..d677d3e 100644
--- a/app.js
+++ b/app.js
@@ -234,7 +234,17 @@ io.sockets.on('connection', function(socket){
// @hide
case "hide":
- Player.Player.list[socket.id].ignorePlayerAttack = ! Player.Player.list[socket.id].ignorePlayerAttack;
+ hasPermission(socket.playerName, 60, function(res){
+ if (res){
+ Player.Player.list[socket.id].ignorePlayerAttack = ! Player.Player.list[socket.id].ignorePlayerAttack;
+ if (Player.Player.list[socket.id].ignorePlayerAttack)
+ socket.emit('addToChat', {ctimestamp: getTimeStamp(0), content: servermsg + "You are now immune to player and monster attacks", tab:"any"});
+ else
+ socket.emit('addToChat', {ctimestamp: getTimeStamp(0), content: servermsg + "You are no longer immune to player and monster attacks", tab:"any"});
+ }
+ else
+ socket.emit('addToChat', {ctimestamp: getTimeStamp(0), content: servermsg + "you dont have permission to use this command!", tab: "any"});
+ });
break;
// @setgm (args:<playername> <lvl>)