SA-MP Forums Archive
About Funcidx - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About Funcidx (/showthread.php?tid=373680)



About Funcidx - JaKe Elite - 31.08.2012

Hello i want to ask a question
Can someone explain to me what Funcidx do.
Because the wiki didn't explain to much about the funcidx.


Re: About Funcidx - [HK]Ryder[AN] - 31.08.2012

Funcidx feature is used to return the ID of a function..
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    printf("ID of OnGameModeInIt: %d", funcidx("OnGameModeInIt"));
    return 1;
}
This code will print ID of OngameModeInIt: -1
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    printf("ID of OnGameModeExit: %d", funcidx("OnGameModeExit"));
    return 1;
}
Similarly this code will print ID of OnGameModeExit: 1

This function isn't very useful and i can't think of a way to use it but you asked what it was so i told you.


Re: About Funcidx - JaKe Elite - 31.08.2012

Well lets move with another topic.

How can i make a teleport with call back i already create like this

pawn Код:
stock rTele:AddPlayerteleport(etc...
now the problem is i don't know how to call it on Call Remote Function

pawn Код:
CallRemoteFunction("OnPlayerTeleport", "ii", playerid, rTele);
Did i use the CallRemoteFunction right?


Re: About Funcidx - [HK]Ryder[AN] - 31.08.2012

If the callback is created in the same script in which u wanna call it you can use
pawn Код:
CallLocalFunction
instead of
pawn Код:
CallRemoteFunction