Cuberite Forum
Global switch (pvp, WL) - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Global switch (pvp, WL) (/thread-439.html)



Global switch (pvp, WL) - Holod - 05-14-2012

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.



RE: Global switch (pvp, WL) - FakeTruth - 05-14-2012

There is an OnTakeDamage callback http://mc-server.org/wiki/doku.php?id=api:plugin:ontakedamage
I think all you need to do is set TDI.Damage to 0


RE: Global switch (pvp, WL) - VinDeP - 05-15-2012

I will write this.