Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: rulk on Sep 13, 2015, 05:28 PM

Title: Forward a timer to a class functiion
Post by: rulk on Sep 13, 2015, 05:28 PM
Hya chaps

Is it possible to send a timer to a class function?

I keep getting the error "The given timer callback does not exist."

here is what I have been putting....

blah <- NewTimer( "MyClass.MyClassFunction", 50, 0, player );

that's for your help...

rulk
Title: Re: Forward a timer to a class functiion
Post by: . on Sep 13, 2015, 05:34 PM
Simple answer... Nope!

I don't want to get into details because there's no point in doing so.
Title: Re: Forward a timer to a class functiion
Post by: rulk on Sep 13, 2015, 05:38 PM
Quote from: S.L.C on Sep 13, 2015, 05:34 PMSimple answer... Nope!

I don't want to get into details because there's no point in doing so.

ok, thanks chap
Title: Re: Forward a timer to a class functiion
Post by: Xmair on Sep 14, 2015, 09:32 AM
Lock if fixed?
Title: Re: Forward a timer to a class functiion
Post by: EK.IceFlake on Sep 14, 2015, 02:40 PM
You can make a function NewClassTimer which calls on another function with vargv and insert and acall which calls on another function and passes the function to call and does compilestring and executes it..
Title: Re: Forward a timer to a class functiion
Post by: DizzasTeR on Sep 14, 2015, 03:25 PM
Quote from: NE.CrystalBlue on Sep 14, 2015, 02:40 PMYou can make a function NewClassTimer which calls on another function with vargv and insert and acall which calls on another function and passes the function to call and does compilestring and executes it..

You make no sense mate.
Title: Re: Forward a timer to a class functiion
Post by: Thijn on Sep 14, 2015, 05:47 PM
He's basically saying you can make another function that will call the classes function.
Title: Re: Forward a timer to a class functiion
Post by: . on Sep 14, 2015, 05:51 PM
Quote from: Thijn on Sep 14, 2015, 05:47 PMHe's basically saying you can make another function that will call the classes function.

You'd still miss the object instance (`this (http://forum.vc-mp.org/?topic=861.msg5558#msg5558)` environment) and calling the function normally would be the same as:
class Test
{
    function Wazzaa(str)
    {
        ::print("class " + str);
    }
}

Test_Wazzaa <- Test.Wazzaa;

Timer <- NewTimer( "Test_Wazzaa", 50, 0, "wazzaaa" );
Title: Re: Forward a timer to a class functiion
Post by: . on Sep 14, 2015, 09:47 PM
A small update (http://forum.vc-mp.org/?topic=1487.0) to the request of this topic.