Skip to content

Latest commit

 

History

History
67 lines (59 loc) · 1.16 KB

File metadata and controls

67 lines (59 loc) · 1.16 KB

samp

  • The samp API module contains functions used to control an open.mp server. Use the API module using:
requires samp
{
	...
}

To use a specific component of the samp API module, do the following:

requires samp
{
	using @global
}

Example 1

  • You can do the following:
requires samp
{
	using @global for
	{
		@global.setserverattrib.hostname("My Server")
	}
}

Components

@global

Function: setserverattrib

This function is used to update server attributes. NOTE: This function has no non-method configuration, so you need to use a method in order to specify a server attribute.

Method: hostname

  • Used to change the server hostname:
requires samp
{
	using @global
}

@global.setserverattrib.hostname("My Server")

Callbacks

  • This component module contains following callbacks:

@onserverinit

  • This callback gets called once the server starts.
@extern
	this->struct=callback
int @onserverinit() public
{
	console.println.log("@onserverinit called!")
	void inlinefunc() inline
	<
		console.println.log("INLINE WORKS!")
	>
	user.inlinefunc

	console.println.log("end")
	return int 1
}