PDA

View Full Version : Call pbulic?


Qur
19/07/2012, 09:02 PM
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?

nepstep
19/07/2012, 09:06 PM
What do you mean?
You could make your own public and forward it for example:

forward ThisIsAPublicFunction()
public ThisIsAPublicFunction()
{
//do something here
}

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

Qur
19/07/2012, 09:11 PM
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

nepstep
19/07/2012, 09:25 PM
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.