Save variable outside a public
#1

Hey guys, I've got the following code:

pawn Код:
new x; // on top of my script

...

public _function()
{
    ...
    x = 11;
    ...
    return true;
}

public _function2() return printf("%d", x); // returns 0 (like x is just initialised)
What I want is the value of x in _function2() (after it has been filled in _function() ofc).
It is not an option for me to return the value at the end of _function() so I can do newvar = _function().

How can I do that?
Reply


Messages In This Thread
Save variable outside a public - by surrender - 21.03.2013, 18:19
Re: Save variable outside a public - by Vince - 21.03.2013, 18:24
Re: Save variable outside a public - by surrender - 21.03.2013, 18:34
Re: Save variable outside a public - by Misiur - 21.03.2013, 18:36

Forum Jump:


Users browsing this thread: 3 Guest(s)