If Player.GetRadLevel > 200
Player.IsRadiationPoisoned = true
timer = 300
timer = (timer-1)/FPS
if Player.GetRadLevel > 150 and timer == 0
damage = Player.GetRadLevel/200
Player.Health = Player.Health-damage
timer = 300
Give me 30-40 mins to debug the hurtevent.Basically I just can't nothing.
WHAT I WANT BEST:
Damage (like bleeding) from 150 RAD - No Radiation Posion, just bleeding or something.
From 450 RAD - Default Radiation Poison
More RAD = More Damage.
Starting with 1 dmg every 10 seconds, to 4 with 450 RAD.
Players would try to not go above 150 if they don't have some Pills and Kits.
WHAT WOULD WORK:
WHAT I MADE ONLY:Code:If Player.GetRadLevel > 200 Player.IsRadiationPoisoned = true
I made a code like "Player.Health-1" with every Hook.... But it's so stupid. It should go loop, not in Hooks, functions, whatever.
Basic script:
Would just work if placed in main loop, not hooks.Code:timer = 300 timer = (timer-1)/FPS if Player.GetRadLevel > 150 and timer == 0 damage = Player.GetRadLevel/200 Player.Health = Player.Health-damage timer = 300
What you call "the main loop" is the main loop from the game, and so, the .Update() called on every frame.Basically I just can't nothing.
WHAT I WANT BEST:
Damage (like bleeding) from 150 RAD - No Radiation Posion, just bleeding or something.
From 450 RAD - Default Radiation Poison
More RAD = More Damage.
Starting with 1 dmg every 10 seconds, to 4 with 450 RAD.
Players would try to not go above 150 if they don't have some Pills and Kits.
WHAT WOULD WORK:
WHAT I MADE ONLY:Code:If Player.GetRadLevel > 200 Player.IsRadiationPoisoned = true
I made a code like "Player.Health-1" with every Hook.... But it's so stupid. It should go loop, not in Hooks, functions, whatever.
Basic script:
Would just work if placed in main loop, not hooks.Code:timer = 300 timer = (timer-1)/FPS if Player.GetRadLevel > 150 and timer == 0 damage = Player.GetRadLevel/200 Player.Health = Player.Health-damage timer = 300
Wild animals also make you bleed.Just make bleedings do 2x damage?
The only way you bleed is from gun shoots I think (which shouldn't matter on a PvE server)
def MakeFunction(self, Player):
Player.Health = Player.Health-1
while 1:
timer(5,1, MakeFunction)
What you want to do will need the hurtevent though.Yes, main game (server) loop, Update(). But how to call Player object in plugin without hook? Fougerite is returning it in hooks like On_Command(self, Player), and not every.
When I tried:
pplayer = Fougerite.Player
pplayer.Health > 40:
It didn't work. Tried also Fougerite.Player()
---
Timer need his own loop. For example:
So you cant make loop in loop, even in plugins. This will crash Rust client. Second think is how to give "MakeFunction" Player object. Of course this code isn't complete, I just wrote it from my head.Code:def MakeFunction(self, Player): Player.Health = Player.Health-1 while 1: timer(5,1, MakeFunction)
No, don't have even gaming mic to talk. Usually I'm using E-Mails, or polish communicator. I don't even know English - just to write, read and listen. Anyway:
HurtEvent - but for use like "Make HurtEvent(Player,Bleeding,2Dmg)", not to check Hurt, because nothing is hurting player when he have RAD at 150.
Basically I could even do it in C# basing on Fougerite Source, it would be very hard, yes, I hate compilers, yes, but if I would know how to set environment and compiler to make proper dll, I would try.
get
{
string str = "Unknown";
Server.GetServer().Broadcast(((int)this.DamageEvent.damageTypes).ToString());
switch (((int)this.DamageEvent.damageTypes))
{
case 0:
return "Bleeding";
case 1:
return "Generic";
case 2:
return "Bullet";
case 3:
case 5:
case 6:
case 7:
return str;
case 4:
return "Melee";
case 8:
return "Explosion";
case 0x10:
return "Radiation";
case 0x20:
return "Cold";
}
return str;
}
Yes, like I told about 2 timesI did debugs too before I found this "Player Metabolism" class.
![]()
import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
RadiationCheck = []
class WhatEver:
# 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 On_PluginInit(self):
for player in Server.Players:
RadiationCheck.append(player)
#6000 = 6 seconds.
Plugin.CreateTimer("RadCheck", 6000).Start()
def RadCheckCallback(self):
Plugin.KillTimer("RadCheck")
for player in RadiationCheck:
rad = int(player.RadLevel)
if rad >= 150:
# You can add radiation:
player.AddRads(float(50))
#or:
player.Damage(float(10))
player.Message("You got dmaaged!")
Plugin.CreateTimer("RadCheck", 6000).Start()
RadiationCheck.append(Player)
Well these new radiation methods and metabolism pointers are not yet included in Fougerite. I might make a build from the latest fixes and additions and release a version called 1.0.7CYeah man working awesome. Don't even need to send message, all "hurting" effect is working. Wow.
I'm owe you (bad english), so if you want something from me I'll do that. I can add some Wikia pages or something. Let me know.
Try to add this to wiki:
As I didn't know how to give this object to my functions, so probably more people had problems with this.Code:RadiationCheck.append(Player)
Oh Shit. xDDAnd one thing, this debug thing what is writing "Fougerite: 0" needs to be deletedIt's showing twice every time I'm hurt.
I don't force any work on anyone regardless if they owe me or not. If you wish to join the wiki editor team thats your call. And even if you do, we don't expect 24/7 editing.Yeah man. Players will be happy. I'll update server now.
I added this to R++ notices"notice3=Special thanks for DreTaX and Fougerite Team 4 making it possible."
So nice. Remember write to me if you need some help, especially with wiki. I know that there is only about 6-8 hooks, but Fougerite have about 30, so you know. Just tell me and I'll help.