• godmode check
    9 replies, posted
how to check if a certain player has godmode enabled ?
Is this player an admin?
[QUOTE=c-unit;24762131]Is this player an admin?[/QUOTE] i just wanna do a check on a player if he has godmode enabled or not like LocalPlayer():InsertGodModeDetectionHere()
You'll have to overwrite the godmode functions. [lua] local gmodeenable = _R.Player.GodEnable function _R.Player:GodEnable() self.GodMode = true gmodeenable(self) end local gmodedisable = _R.Player.GodDisable function _R.Player:GodDisable() self.GodMode = false gmodedisable(self) end function _R.Player:HasGodMode() return self.GodMode end [/lua]
[QUOTE=Wizard of Ass;24777932]You'll have to overwrite the godmode functions. [lua] local gmodeenable = _R.Player.GodEnable function _R.Player:GodEnable() self.GodMode = true gmodeenable(self) end local gmodedisable = _R.Player.GodDisable function _R.Player:GodDisable() self.GodMode = false gmodedisable(self) end function _R.Player:HasGodMode() return self.GodMode end [/lua][/QUOTE] This code is placed server-side?
Yes
There is no way to check clientside if the player is in god mode, as far as I am aware. The server would have to network it to the client. ( Given you asked for LocalPlayer( ):IsInGodMode( ) )
[QUOTE=Kogitsune;24778902]There is no way to check clientside if the player is in god mode, as far as I am aware. The server would have to network it to the client. ( Given you asked for LocalPlayer( ):IsInGodMode( ) )[/QUOTE] Yeh you would have to NWInt for clientside or there is no way.
[QUOTE=Kogitsune;24778902]There is no way to check clientside if the player is in god mode, as far as I am aware. The server would have to network it to the client. ( Given you asked for LocalPlayer( ):IsInGodMode( ) )[/QUOTE] not even on myself?
[QUOTE=XoX;24778926]not even on myself?[/QUOTE] [lua] local gmodeenable = _R.Player.GodEnable function _R.Player:GodEnable() self:SetNWINt("GodMode",1) gmodeenable(self) end local gmodedisable = _R.Player.GodDisable function _R.Player:GodDisable() self:SetNWINt("GodMode",0) gmodedisable(self) end --Clientside function _R.Player:HasGodMode() return self:GetNWINt("GodMode") end [/lua]
Sorry, you need to Log In to post a reply to this thread.