View Single Post
  #2  
Old 07-20-2006, 09:43 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The params[] array is a global variable which always contains the parameters passed to a script call, either from outside (like onActionServerside) or by calling the function of another object. The params[] variable is not containing the parameters passed to the function. That's why you need to save it to a temporary variable if you want to use it later.

If the onActionServerSide function always expects the same number of parameters, you can also name the parameters in the function-declaration, then you don't need to copy them to temporary variables yourself. Something like this:
PHP Code:
function onActionServerside(chat) {
  echo(
"player chat: " chat);

Reply With Quote