Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 707 Bytes

client function.md

File metadata and controls

35 lines (29 loc) · 707 Bytes

Event Functions


triggerServerEvent

This function is used to trigger a server event created by addEventHandler

Syntax

triggerServerEvent(string event, ...)

Arguments

  • string event: The name of the event to trigger
  • ...: (Optional) Arguments to sent to the events function

Return Values

Returns 'true' if successful, 'false' otherwise.

Example

//CLIENT
function playerSpawn( playerid, nickname )
{
	triggerServerEvent( "myEvent", "My String" );
}
addEventHandler( "onClientPlayerConnect", playerSpawn );

//SERVER
addEventHandler("myEvent",
function( playerid, str )
{
	log( "Output: " + str );
});