View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-11-2015 , 11:41   Re: [Pawn Question] How to set a function as a parameter for a function?
Reply With Quote #17

Quote:
Originally Posted by nergal View Post
just an expansion on this thread

I tried to do this

PHP Code:
Function func pack.ReadFunction();

int param1 pack.ReadCell();
if ( 
param1 func(param1); 
and I get an error saying "invalid function call, not a valid address."

Is there seriously no other way to call a function without using call_startfunction?
iirc Function variables aren't closures. You have to use Call_StartFunction or put them into a Forward to call them.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline