This function is used to trigger a server event created by addEventHandler
triggerServerEvent(string event, ...)
- string event: The name of the event to trigger
- ...: (Optional) Arguments to sent to the events function
Returns 'true' if successful, 'false' otherwise.
//CLIENT
function playerSpawn( playerid, nickname )
{
triggerServerEvent( "myEvent", "My String" );
}
addEventHandler( "onClientPlayerConnect", playerSpawn );
//SERVER
addEventHandler("myEvent",
function( playerid, str )
{
log( "Output: " + str );
});