I have a mod that uses
function useBricks()
{
//code and parent
}
I want to be able to disable the parent and call a command to server when the client joins the server with it enabled.
But once the client joins another server the parent works and he should be able to use the brick menu like normal
How do I do this?
CLIENT
function clientCmdBrickOverride_Ack()
{
if(isEventPending($BrickOverride_Timeout);
cancel($BrickOverride_Timeout);
useBricks(2);
}
package UseBricksOverride
{
function useBricks(%whichCmd)
{
if(%whichCmd == 1)
parent::useBricks();
else if(%whichCmd == 2)
{
//do your override thing here
}
else
{
$BrickOverride_Timeout = schedule(1000,0,"useBricks",1);
commandToServer('BrickOverride_RequestAck');
}
}
};
activatepackage("UseBricksOverride");
SERVER
function serverCmdBrickOverride_RequestAck(%client)
{
commandToClient(%client,'BrickOverride_Ack');
}
This is sort of your basis, but you should test it.