0.68.9 servers now support function array parameters by reference!
Woot!
Good News!
erm, isn't it obvious?
Really needs an example (i've got a nice generic school script which ill post later), but essentially..
Say you've got an array like :
and you've got a nice lil function that loops the array, building up an OSD or something.
Now you can call the function with the array as a parameter, e.g :
So.. if you want to display a different list (for a different school building for instance), you can just create another array ( $maSkillsList2 for instance ) and call the same display function as in :
Hence I can now go and delete about 60% of my script code, making everything much more maintainable and generic. Well i consider that a woot :]
Really needs an example (i've got a nice generic school script which ill post later), but essentially..
Say you've got an array like :
Code: Select all
$maSkillsList1[] =
{
"Farmer",
"Lumberjack",
"Miner",
"",
}
Now you can call the function with the array as a parameter, e.g :
Code: Select all
ShowSchoolsOSD( $maSkillsList1 )
Code: Select all
ShowSchoolsOSD( $maSkillsList2 )
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am