Type casting in functions
Hello. I would like to create function with default value.
PHP Code:
|
Re: Type casting in functions
Float:myVar[3]={0.0, 0.0, 0.0}
|
Re: Type casting in functions
Oh darn I forgot to put it in my example.
PHP Code:
Cause when function is public parser shows me fallowing error. Quote:
|
Re: Type casting in functions
Because if you put 'public', it means that you function is a callback from a forward, meaning with specific and defined params. If your function is not a callback, you don't have to use public but keeping it private.
|
Re: Type casting in functions
I have to use public to I could use this function as native
|
Re: Type casting in functions
Quote:
|
Re: Type casting in functions
PHP Code:
|
Re: Type casting in functions
Don't use the same name for natives name and the callback.
register_native ( "cp_teleport", "_cp_teleport" ); for example. or just native_cp_teleport. public _cp_teleport () { } And since it's a native, the params are not passed like that. If I remember you have to use get_param() etc.. |
Re: Type casting in functions
Quote:
|
Re: Type casting in functions
Quote:
I just wanted to know why he wanted to use a public type function. His message was bad english too. |
| All times are GMT -4. The time now is 15:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.