About Funcidx
#1

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.
Reply
#2

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.
Reply
#3

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?
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)