Cuberite Forum

Full Version: Global switch (pvp, WL)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Help with writing global pvp and access switches.

That is, I need the commands:
/globalpvp on - and players can fight
/globalpvp off - and the players can not fight

/globalaccess on - players can log on to
/globalaccess off - players can not log on to

With regard to access: probably need to return true in the method OnLogin, if set the switch /globalaccess off (if isGlobalAccess == false)

As for the pvp no ideas.
There is an OnTakeDamage callback http://mc-server.org/wiki/doku.php?id=ap...takedamage
I think all you need to do is set TDI.Damage to 0
I will write this.