Author Topic: CallServerFunc  (Read 2154 times)

VetalYA

  • Guest
CallServerFunc
« on: November 13, 2011, 12:10:49 pm »
CallServerFunc(params)

I need  correct Syntax for this function, and wiki contain nothing about it.

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions/Scripts/CallServerFunc

Thank you in advance.
« Last Edit: November 13, 2011, 02:22:02 pm by VetalYA »

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: CallServerFunc
« Reply #1 on: November 13, 2011, 06:58:21 pm »
CallServerFunc ( string pathToScript, string functionName, [parameters] );



pathToScript - The path to the script without Scripts/. A script in Scripts/Main/Main.nut would be Main/Main.nut

functionName - The name of the function, for example "myFunction"

[parameters...] - This is optional; any parameters to be included.



Example

Code: (Main/Client.nut) [Select]
CallServerFunc( "Main/Main.nut", "MyFunction", "Hello World", "Foobar" );

Code: (Main/Main.nut) [Select]
function MyFunction( parameter1, parameter2 )
{
    print( parameter1 );
    print( parameter2 );
}

Code: (Server Output) [Select]
Hello World
Foobar
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

VetalYA

  • Guest
Re: CallServerFunc
« Reply #2 on: November 14, 2011, 07:48:00 pm »
Big Thank  ;)

 

© Liberty Unleashed Team.