textDisplayGetObservers | Multi Theft Auto: Wiki Skip to content

textDisplayGetObservers

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function can be used to retrieve all the players currently observing a specified textdisplay.

Syntax

textDisplayGetObservers ( )

Code Examples

server
function removeAllObservers ( player , command )
local tObservers = textDisplayGetObservers ( serverDisplay ) -- get a table of all observers in 'serverDisplay' text display
if tObservers then -- if got the table
for index,player in ipairs ( tObservers ) do -- loop the table
textDisplayRemoveObserver ( serverDisplay , player ) -- remove the player from the text display
end
end
end
addCommandHandler("removeAllObservers",removeAllObservers)