Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: habi on Mar 11, 2022, 04:10 AM

Title: Do squirrel have pass by reference
Post by: habi on Mar 11, 2022, 04:10 AM
I was trying to pass a variable by reference.
The only solution i found was creating an array of single element and pass it.
function inc(i){i[0]+=1}
local a=[4];inc(a);print(a[0])
[SCRIPT]  5

Do anybody any other way?
Title: Re: Do squirrel have pass by reference
Post by: DizzasTeR on Mar 11, 2022, 01:24 PM
Nope