Jump to content

Question about OOP


Banex

Recommended Posts

I do not understand how to use the variable, the two functions have the same variable, so if I use the variable of isPlayerMuted function, player.muted() without putting any argument as to whether the player is muted or not, I'll have a warning message in debugscript not to use the obligatory argument setPlayerMuted function?

Link to comment
  • MTA Team

It should work like this (not sure)

  
local player = Player.getRandom() 
  
-- Mute the player 
player:setMuted(true) 
player.muted = true 
setPlayerMuted(player, true) 
  
-- Unmute the player 
player:setMuted(false) 
player.muted = false 
setPlayerMuted(player, false) 
  
-- Is the player muted? 
if player.muted then --[[ ... ]] end 
if player:isMuted() then --[[ ... ]] end 
if isPlayerMuted(player) then --[[ ... ]] end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...