Solved Rad zones and Animals stronger

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Yes I can help. Basic things like hooks. Not everybody know how to work with source so I can add sometimes some pages.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Yes I can help. Basic things like hooks. Not everybody know how to work with source so I can add sometimes some pages.
I forgot to tell Mike to add the Damage method in 1.0.8 (Maybe I didn't even list it on the git)

So this is the following thing that you can add:

Python:
RadiationCheck = []

class Test:

    TakeDamage = None

    def On_PluginInit(self):
        self.TakeDamage = Util.TryFindReturnType("TakeDamage")

    # Respawned and fresh connected players are handled here.
    def On_PlayerSpawned(self, Player, SpawnEvent):
        RadiationCheck.append(Player)

    def On_PlayerKilled(self, DeathEvent):
        if DeathEvent.Victim is not None:
            RadiationCheck.remove(DeathEvent.Victim)

    def On_PlayerDisconnected(self, Player):
        RadiationCheck.remove(Player)


    def RadCheckCallback(self, timer):
        timer.Kill()
        for player in RadiationCheck:
            if int(player.RadLevel) >= 150:
                # You can add radiation:
                player.AddRads(50)
                #or:
                self.TakeDamage.HurtSelf(player.PlayerClient.controllable.character, None)
        Plugin.CreateTimer("RadCheck", 6000).Start()
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Ok thanks. I'll wait until some new version, because this is crucial plugin for my server.

Do you know why after some time (I don't know what, maybe 24 hours) it's stop working? No error or something, rad just stops killing. I have ideas that it's maybe some cheater, or maybe Admin God have something to do with this. But naah, it looks like just an effect of time. It's working again for some hours when I restart server.

It's similiar to some spikes bug. Sometimes it's working against everybody, sometimes killing just owner of them. No idea why.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Ok thanks. I'll wait until some new version, because this is crucial plugin for my server.

Do you know why after some time (I don't know what, maybe 24 hours) it's stop working? No error or something, rad just stops killing. I have ideas that it's maybe some cheater, or maybe Admin God have something to do with this. But naah, it looks like just an effect of time. It's working again for some hours when I restart server.

It's similiar to some spikes bug. Sometimes it's working against everybody, sometimes killing just owner of them. No idea why.
Alright. But you can use that, It will be just the same, I just added the takedamage class as a variable there, so you can access It.

It must be something with C#. The timers just die for nothing. This is the reason why I always kill the timers and re run them to make them last longer. No idea. Maybe you should pick an event, and check with Plugin.GetTimer if the timer is running or not.
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Looks like there you forgot about more variables/properties/methods or however you call them:

Was working fine in 1.0.8 rc2:
Code:
On_PlayerHurt:
AttributeError: can't assign to read-only property Health of type 'Player'
And looks like you can still assign Health to building parts, or NPC's.

Coming back to rads:
It's not even showing me errors with my old RAD Zone plugin.. Debugging is a little bit harder now. If it's timer, it should show me error again and again and again. I didn't update code yet.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Looks like there you forgot about more variables/properties/methods or however you call them:

Was working fine in 1.0.8 rc2:
Code:
On_PlayerHurt:
AttributeError: can't assign to read-only property Health of type 'Player'
And looks like you can still assign Health to building parts, or NPC's.

Coming back to rads:
It's not even showing me errors with my old RAD Zone plugin.. Debugging is a little bit harder now. If it's timer, it should show me error again and again and again. I didn't update code yet.
It's probably not showing It since the method is missing.
If you want to damage the player, you can use the takedamage class.

The best thing would be if you would go here https://github.com/Notulp/Fougerite/issues and request your needs.
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Looks like there you forgot about more variables/properties/methods or however you call them:

Was working fine in 1.0.8 rc2:
Code:
On_PlayerHurt:
AttributeError: can't assign to read-only property Health of type 'Player'
And looks like you can still assign Health to building parts, or NPC's.

Coming back to rads:
It's not even showing me errors with my old RAD Zone plugin.. Debugging is a little bit harder now. If it's timer, it should show me error again and again and again. I didn't update code yet.
Yeah, Health property no longer has a setter.
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
@DreTaX Maybe I will try (shit.. another account.....) but.. Why did you delete it? Now I really can't update my server, as whole gameplay is basing on Health etc.

Maaan ;)
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
@DreTaX Maybe I will try (shit.. another account.....) but.. Why did you delete it? Now I really can't update my server, as whole gameplay is basing on Health etc.

Maaan ;)
I didn't delete It. It was probably mike. Go and complain on the github issues please so he won't forget to do it. If you want, I can get you a dll with a setter for now. Do you need It?
 
  • Like
Reactions: Snake

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I mean you (your dev team), not just you. I don't know who is who :p It's weird when there is something and boom, next version it's deleted.

If you could, I will be happy. But I think there is more issues, what I can't find before I get this working Health etc
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
I mean you (your dev team), not just you. I don't know who is who :p It's weird when there is something and boom, next version it's deleted.

If you could, I will be happy. But I think there is more issues, what I can't find before I get this working Health etc
Until next version comes, you can also do: Player.PlayerClient.controllable.health = 100
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
I finally have some time, following code:

Code:
def RadCheckCallback(self):
        Server.Broadcast("Timer")
        Plugin.KillTimer("RadCheck")
        for player in RadiationCheck:
            rad = int(player.RadLevel)
            Server.Broadcast("Checking rad: "+str(rad))
            if rad >= 150:
                self.TakeDamage.HurtSelf(player.PlayerClient.controllable.character, None)
                Server.Broadcast("Radiation above 150")
                #player.Damage(float(rad/80))
        Plugin.CreateTimer("RadCheck", 6000).Start()
Worked only for 3 times (3 loops, then nothing.) After reloading 6 times. Debug "Checking rad" showed always only once, last.

Also this "TakeDamage" makes nothing. Please make them back for 1.0.9 version... I'm writing on GITHUB now. I'll wait until it to make this plugin.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Oh I got It. here @MasterPeace

Python:
def RadCheckCallback(self, timer):
        Server.Broadcast("Timer")
        timer.Kill()
        for player in RadiationCheck:
            rad = int(player.RadLevel)
            Server.Broadcast("Checking rad: "+str(rad))
            if rad >= 150:
                self.TakeDamage.HurtSelf(player.ourPlayer.controllable.character, float(rad / 80))
                Server.Broadcast("Radiation above 150")
                #player.Damage(float(rad/80))
        Plugin.CreateTimer("RadCheck", 6000).Start()
 
Last edited: