summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjak1 <jak1@themanaworld.org>2023-01-12 23:07:53 +0100
committerjak1 <jak1@themanaworld.org>2023-01-12 23:07:53 +0100
commit3a4d0c8b75d6296756fd53cd1d87bfd16cffad54 (patch)
treeac096aca4e7f0ca0ae9f7f8d62a40e060658356f
parent20548feae0ad2ace70e92243b1ce48fa1bf50d08 (diff)
downloadthepixelworld-3a4d0c8b75d6296756fd53cd1d87bfd16cffad54.tar.gz
thepixelworld-3a4d0c8b75d6296756fd53cd1d87bfd16cffad54.tar.bz2
thepixelworld-3a4d0c8b75d6296756fd53cd1d87bfd16cffad54.tar.xz
thepixelworld-3a4d0c8b75d6296756fd53cd1d87bfd16cffad54.zip
added feedback & permissions to @hide
-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>)