Page 2 of 2

Re: MH2 :Prevent player who don't play to get bonus

Posted: Thu Feb 08, 2024 4:04 pm
by Letylove49
Barbie wrote: Tue Feb 06, 2024 9:19 pm
Letylove49 wrote: Tue Feb 06, 2024 12:14 am and i have removed this who is usless : if(PRand.PlayerReplicationInfo != None && PRand.PlayerReplicationInfo.score <= 5000)
Not really useless: PRand (or Dest in your alternative code) don't have a PlayerReplicationInfo in seldom cases¹ and so your new code accesses NONE if you don't check it.

(1) E.g. when SkaarjTrooper pick a weapon.
I don’t know what this access none is.
When I said that this was useless I spoke to ignore inactive players because I had put this condition in the wrong function and was not doing what I wanted.
I put this "PRand = GetRandomPlayer();" instead of " function Pawn GetRandomPlayer()" so it didn’t work