AdminCommands

[KR]teledong

New Member
Member
Oct 13, 2014
6
0
1
36
Parts Unknown
Please Add this :)
Python:
        elif cmd.cmd == "tppos":
            if not Player.Admin:
                Player.Message("You aren't an admin!")
                return
            if len(args) == 3:
                Player.Teleport(float(args[0]), float(args[1]), float(args[2]))
 

[KR]teledong

New Member
Member
Oct 13, 2014
6
0
1
36
Parts Unknown
I Think godmode code should be changed to

Python:
    def On_PlayerAttacked(self, PlayerHurtEvent):
            get = DataStore.Get("godmode", PlayerHurtEvent.Victim.SteamID)
            if get is not None and get == 1:
                PlayerHurtEvent.DamageAmount = 0
 

Louis

Member
Member
Oct 11, 2014
33
3
8
36
Parts Unknown
I Think godmode code should be changed to

Python:
    def On_PlayerAttacked(self, PlayerHurtEvent):
            get = DataStore.Get("godmode", PlayerHurtEvent.Victim.SteamID)
            if get is not None and get == 1:
                PlayerHurtEvent.DamageAmount = 0
You should also take into account:

Fall damage
Downing
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
I Think godmode code should be changed to

Python:
    def On_PlayerAttacked(self, PlayerHurtEvent):
            get = DataStore.Get("godmode", PlayerHurtEvent.Victim.SteamID)
            if get is not None and get == 1:
                PlayerHurtEvent.DamageAmount = 0
I already said that, Plus im looking at it atm
 

thren

New Member
Member
Oct 14, 2014
1
0
1
60
Great plugin, tp's work a treat.
Just waiting on God mode to stop drowning :)
 

[KR]teledong

New Member
Member
Oct 13, 2014
6
0
1
36
Parts Unknown
Suggest :
Python:
def On_PluginInit(self):
        Plugin.CreateTimer("CheckHealTimer", 1000).Start()

def CheckHealTimerCallback(self, timer):
        keys = DataStore.Keys("godmode")
        for id in keys:
            godPlayer = Server.FindPlayer(id)
            if godPlayer.Health < 80:
                godPlayer.basePlayer.TakeDamage(-100)
        Plugin.CreateTimer("CheckHealTimer", 1000).Start()
This code will be totally god mode (if your health is lower then 80, set to 100.)
But it has effect when health regenerate (Attacked image).
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
Suggest :
Python:
def On_PluginInit(self):
        Plugin.CreateTimer("CheckHealTimer", 1000).Start()

def CheckHealTimerCallback(self, timer):
        keys = DataStore.Keys("godmode")
        for id in keys:
            godPlayer = Server.FindPlayer(id)
            if godPlayer.Health < 80:
                godPlayer.basePlayer.TakeDamage(-100)
        Plugin.CreateTimer("CheckHealTimer", 1000).Start()
This code will be totally god mode (if your health is lower then 80, set to 100.)
But it has effect when health regenerate (Attacked image).
Im not gonna add a timer for It...
You can simply use the event for It also, but Im pretty.sure there is a way around It.

Sent from my Samsung Galaxy S4
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
After some time messing around with it, I don't On_PlayerAttacked is a hook. (A working one that is)
I just done:
Python:
def On_PlayerAttacked(self, PlayerHurtEvent):
    Server.Broadcast("420 blaze")
and that doesn't even do anything.
 

Jakkee

Plugin Developer
Plugin Developer
Contributor
Jul 28, 2014
1,465
925
113
Australia
What about using: On_PlayerTakeDamage(PlayerTakeDmgEvent ptd)
then set the damage to 0