SA-MP Forums Archive
print what call this funcion - 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: print what call this funcion (/showthread.php?tid=419009)



print what call this funcion - Azazelo - 27.02.2013

Is it possible to print what callback call funcion?

exemple:

pawn Код:
stock funcion(playerid)
{

print("Called by WHAT??");
//printout : Called by OnPlayerUpdate

}

public OnPlayerUpdate(playerid)
{
funcion(playerid);
return 1;
}



Re: print what call this funcion - [MG]Dimi - 27.02.2013

It is possible like this:
pawn Код:
public OnPlayerUpdate(playerid)
{
    print("OnPlayerUpdate");
    return 1;
}

public OnPlayerUpdate(playerid)
{
    print("OnPlayerConnect");
    return 1;
}

//etc... etc...



Re: print what call this funcion - xeeZ - 27.02.2013

If you have CrashDetect you can do something like this:

pawn Код:
stock function(playerid) {
    // Run time error 1: "Forced exit"
    #emit halt 1
}
and you'll see the caller in the AMX backtrace


Re: print what call this funcion - Azazelo - 27.02.2013

You must spread some Reputation around before giving it to ****** again.
xeeZ Rep +
[MG]Dimi +

Thank you for helped me to solve this.