Page 1 of 1
[zScript] Check if player has godmode activated
Posted: Wed Feb 12, 2020 1:29 pm
by Cherno
I simply want to check, in zScript, if a PlayerPawn is invulnerable from having activated godmode ("god" in console, or IDDQD).
Checking for the INVULNERABLE flag doesn't work.
Re: [zScript] Check if player has godmode activated
Posted: Wed Feb 12, 2020 3:06 pm
by gwHero
Not tested, but this should work:
let player = self.player;
if (player.cheats & CF_GODMODE)
...
(see player.zs in gzdoom.pk3)
Re: [zScript] Check if player has godmode activated
Posted: Wed Feb 12, 2020 8:12 pm
by Cherno
Thanks. 3saster provided a solution on Discord
Code: Select all
CPlayer.cheats & (CF_GODMODE | CF_GODMODE2)
https://github.com/coelckers/gzdoom/blo ... 1155-L1186
Re: [zScript] Check if player has godmode activated
Posted: Sat May 15, 2021 7:33 am
by Logan MTM
There is a way to do this check in ACS?