HttpClear

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function removes all text from the current HTML output.

Syntax

bool httpClear ( )

Returns

Returns true if the output buffer was cleared successfully, false otherwise.

Example

This sample resource page adds a message to be outputted saying there are players in the server, but clears output if the server is empty so a blank page is displayed instead.

[html]
<html>
   <head/>
   <body>
      There are some players in the server.
   </body>
</html>
<*

if getPlayerCount() == 0 then

  httpClear()

end

[html]*>

See Also

These functions can only be used from within lua blocks in HTML pages hosted by the server