CallClientFunc
From Liberty Unleashed Wiki
This function will call a function from a loaded script at client side.
Syntax
CallClientFunc( player Player, string scriptPath, string funcName, params )
Arguments
- Player - The player you want to call the client function at
- scriptPath - The path of the script including the folder and filename
- funcName - The function being called
- params - Any parameters which need to be passed
Example
This example will call a function from SomeScript/client.nut when a player types /messageme.
function onPlayerCommand( pPlayer, cmd, text ) { if ( cmd == "somecmd" ) { CallClientFunc( pPlayer, "SomeScript/cain.nut", "SayHello", "param1", 2 ); } return 1; }
Notes
The function onPlayerCommand is used in in this example. More info about them in corresponding pages.