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]))
Drowning, Falldamage, Bleeding, Animal attacks.What doesn't work? A little detail would help him pin point the problem
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: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 atmI 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
Nah, Its good. I used VB to check it. I.think there is an extra space tho after itI think its DamageAmount not damageAmount.
(Haven't looked through dotpeek yet)
Doesn't fix it (Well for me anyway)change the last line to
PlayerHurtEvent.DamageAmount = 0
I had a little mess around and I think its not getting the players steamIDWhen I get home i will probably test it, Or maybe Jakkee will find the prob.[emoji41]
Sent from my Samsung Galaxy S4
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()
Im not gonna add a timer for It...Suggest :
This code will be totally god mode (if your health is lower then 80, set to 100.)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()
But it has effect when health regenerate (Attacked image).
def On_PlayerAttacked(self, PlayerHurtEvent):
Server.Broadcast("420 blaze")
It says it loads in console with no errors.It is, but you say it doesnt load?
Sent from my Samsung Galaxy S4