AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   More Help With Functions (https://forums.alliedmods.net/showthread.php?t=26710)

capndurk 04-07-2006 21:58

More Help With Functions
 
wait a minute, that's not fair...

I get this error:

error 067: variable cannot be both a reference and an array (variable "arg1")

and I use this code:

Code:
&arg1[]

but why can't I use that if the parse_loguser() native can?

VEN 04-08-2006 09:20

You can't use "switch" for the name of your function because it's Pawn's "reserved word".

Quote:

Originally Posted by Pawn "The Language" guide
Arguments that occupy a single cell can be passed by value or by reference.
The default is "pass by value".
To create a function argument that is passed by reference, prefix the argument name with the character &.

Example:
Code:
swap(&a, &b) {     new temp = b     b = a     a = temp }


capndurk 04-08-2006 14:40

removed


All times are GMT -4. The time now is 16:44.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.