Can I make array of functions?
#2

No, but you can make a function that accepts a parameter to do what you want.
pawn Код:
CreateSpecialVehicle(Something)
{
    switch (Something)
    {
        case 1: return CreateVehicle(562, 0, 0, 0, 0, -1, -1, 200);
        case 2: return CreateVehicle(412, 0, 0, 0, 0, -1, -1, 200);
        case 3: return CreateVehicle(592, 0, 0, 0, 0, -1, -1, 200);
        case 4: return CreateVehicle(517, 0, 0, 0, 0, -1, -1, 200);
    }

    return 0;
}
What you want, is a way to store function-pointers along with it's parameters.
AFAIK, pawn doesn't handle function pointers.
Reply


Messages In This Thread
Can I make array of functions? - by Stuneris - 11.02.2014, 15:57
Re: Can I make array of functions? - by PowerPC603 - 11.02.2014, 16:01
Re: Can I make array of functions? - by Stuneris - 11.02.2014, 16:06
Re: Can I make array of functions? - by PowerPC603 - 11.02.2014, 16:11
Re: Can I make array of functions? - by Stuneris - 11.02.2014, 16:13
Re: Can I make array of functions? - by PowerPC603 - 11.02.2014, 16:23

Forum Jump:


Users browsing this thread: 1 Guest(s)