CallClientFunc

From Liberty Unleashed Wiki
Revision as of 09:15, 13 January 2011 by Thijn (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function will call a function from a loaded script at client side.

Syntax

  1. 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.

  1.  
  2. function onPlayerCommand( pPlayer, cmd, text )
  3. {
  4. if ( cmd == "somecmd" )
  5. {
  6. CallClientFunc( pPlayer, "SomeScript/cain.nut", "SayHello", "param1", 2 );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function onPlayerCommand is used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox