SA-MP Forums Archive
Call pbulic? - 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: Call pbulic? (/showthread.php?tid=361050)



Call pbulic? - Qur - 19.07.2012

Hey.. I want to know if there's any option to make public to work..
like if I type a command it makes a public to work?


Re: Call pbulic? - nepstep - 19.07.2012

What do you mean?
You could make your own public and forward it for example:
pawn Код:
forward ThisIsAPublicFunction()
public ThisIsAPublicFunction()
{
//do something here
}

public OnGameModeInit()
{
ThisIsAPublicFunction(); //will call this public function
return 1;
}



Re: Call pbulic? - Qur - 19.07.2012

I'm trying to make a command that call the public OnPlayerDisconnect cuz right now when players disconnect on my script it saves his stats.. so I want that when I type the command it will save it, without type the whole OnPlayerDisconnect functions


Re: Call pbulic? - nepstep - 19.07.2012

I'm not sure how you could possibly do something like that.
The easiest way is to create a new public function and then copy everything from OnPlayerDisconnect inside this public function, so it will be like a duplicate.
And then simply call the duplicate function you just created.