Blockland Forums > Modification Help
Save command doesn't work. Please help.
(1/4) > >>
Fatcorny:
I am making a save command where you type /Save SaveNameHere.  I have the following code, but it doesn't work.
(This is a client-sided mod)


--- Code: ---package Saver
{
function clientcmdSave(%client, %name)
{
saveBricks("saves/saveCommand/" @ %name @ ".bls", 1, 1);
messageClient(%client,'',"Saved" SPC $server::Brickcount SPC "brick(s) to" SPC %name @ ".bls.");
}
};
function gameconection::onClientSpawn(%client)
{
activatePackage(Saver);
parent::onClientSpawn(%client);
}

--- End code ---

Please help.
Content copyright © 2010 MJ Studios LLC., and is protected from copying.
ZSNO:

--- Quote from: Fatcorny on August 10, 2010, 11:14:59 AM ---I am making a save command where you type /Save SaveNameHere.  I have the following code, but it doesn't work.
(This is a client-sided mod)


--- Code: ---package Saver
{
function clientcmdSave(%client, %name)
{
saveBricks("saves/saveCommand/" @ %name @ ".bls", 1, 1);
messageClient(%client,'',"Saved" SPC $server::Brickcount SPC "brick(s) to" SPC %name @ ".bls.");
}
};
function gameconection::onClientSpawn(%client)
{
activatePackage(Saver);
parent::onClientSpawn(%client);
}

--- End code ---

Please help.
Content copyright © 2010 MJ Studios LLC., and is protected from copying.

--- End quote ---
WHY? WHY IN THE WORLD NO ONE IS GOING TO STEAL THIS STUFF GOD
Anyway

--- Code: ---function clientcmdSave(%client, %name)
{
saveBricks("saves/saveCommand/" @ %name @ ".bls", 1, 1);
messageClient(%client,'',"Saved" SPC $server::Brickcount SPC "brick(s) to" SPC %name @ ".bls.");
}
--- End code ---
You can't do a client sided command to a slash unless you have Truce's thing that allows that.
Crysist:
Why did you parent clientcmdsave? And why didn't you parent gameconection::onClientSpawn?

--- Code: ---function clientcmdSave(%client, %name)
{
saveBricks("saves/saveCommand/" @ %name @ ".bls", 1, 1);
messageClient(%client,'',"Saved" SPC $server::Brickcount SPC "brick(s) to" SPC %name @ ".bls.");
}

package Saver
{
function gameconection::onClientSpawn(%client)
{
activatePackage(Saver);
parent::onClientSpawn(%client);
}
};
--- End code ---
Headcrab Zombie:
Several problems
clientCmds can't be called through a slash command unless you have another script
Don't package the client command
If this is client sided, why is there a modified serverSide method? Just replace that entire part with activatePackage. Or at least you would if you needed a package. Which you don't.
messageClient is a serverside function. Use NewChatSO.addLine


--- Quote from: Fatcorny on August 10, 2010, 11:14:59 AM ---Content copyright © 2010 MJ Studios LLC., and is protected from copying.

--- End quote ---
No one is going to steal something that doesn't work.
Fatcorny:
Cna anyone fix this and give me the right code?
Navigation
Message Index
Next page

Go to full version