Ah, yes sorry I got confused.
In your code above the p.Player variable is local to the function so is unknown outside the "scope" of the function.
However you are returning the p.Player type handle from your function so from the main body of your code if you want a variable to track this particular instance created by the function you go:
myplayer.Player=CreatePlayer(...)
which means myplayer will point to the same type you created and were manipulating with the local p variable inside the function
you can then access the type's fields from the main program using:
myplayer\model
In your code above the p.Player variable is local to the function so is unknown outside the "scope" of the function.
However you are returning the p.Player type handle from your function so from the main body of your code if you want a variable to track this particular instance created by the function you go:
myplayer.Player=CreatePlayer(...)
which means myplayer will point to the same type you created and were manipulating with the local p variable inside the function
you can then access the type's fields from the main program using:
myplayer\model