796
Modification Help / Re: scripting help [STILL NEEDS HELP!]
« on: February 13, 2009, 07:57:02 AM »
No.
Are you wanting server sided code or client sided?
Are you wanting server sided code or client sided?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
You don't need to package everything, unless...uhhh i forgot what things you should package ._.http://forum.blockland.us/index.php?topic=21811.0
package Lolzplant
{
function fxDtsBrick::onPlant(%brick)
{
parent::onPlant(%brick);
%client = getBrickGroupFromObject(%brick).client;
%Colorz = %brick.getcolorid();
%brickdatablock = %brick.getdatablock();
%Bmass = %brickdatablock.BrickSizeX * %brickdatablock.BrickSizeY * %brickdatablock.BrickSizeZ;
if(%Colorz >= 1 && %Colorz <= 46)
{
%Mattobuild = "Special";
}
if(%Colorz >= 47 && %Colorz <= 55)
{
%Mattobuild = "Stone";
}
if(%client.quantity[%Mattobuild] < %Bmass)
{
commandToClient(%client, 'centerPrint', "\c6You need " @ %Bmass @ " \c2" @ %Mattobuild @ "!", 3);
%brick.KillBrick();
return;
}
%client.quantity[%Mattobuild] -= %BMass;
}
};
activatepackage(Lolzplant);That should work. You are using the wrong variables. (I just looked up an old building script I made, which when I was making it I found the variables exactly how I told you to when I first replied.)
Entering clientCmdChatMessage(8026, , , 133 [N]GamefandanTRPA: hello, [N], Gamefandan, TRPA, hello) //This is the first line, this is when the server is telling the client that someone spoke. (this is probably what you want to package, just make sure to call the parent, or you'll break your chat)
Entering onChatMessage([N]GamefandanTRPA: hello, , ) //This is a function that was called by the first function.
Entering newChatHud_AddLine([N]GamefandanTRPA: hello) //This is another function, the function names should be speaking for themselfs. This is telling the chat hud in your game to add a new line to add a new line.
Entering NewChatSO::addLine(8170, [N]GamefandanTRPA: hello) //Each one of these lines is when the function is being entered within the processing of the code. What comes after the function, as is in the parenthesis are what is entered into the function. Note that datablocks and other named things are reverted into their number form when being shown here, so you may need to look the number up.
Entering NewChatSO::displayLatest(8170)
Entering newMessageHud::updatePosition(newMessageHud)
Leaving newMessageHud::updatePosition() - return //This is the first leaving line. The function is being left, and the program flow is going back into the function that called the function that is ending. There is nothing that is returned in this code, but if there was something, it would be shown after "- return".
Entering newChatHud_UpdateScrollDownIndicator()
Entering newChatHud_UpdateIndicatorPosition()
Leaving newChatHud_UpdateIndicatorPosition() - return
Leaving newChatHud_UpdateScrollDownIndicator() - return
Leaving NewChatSO::displayLatest() - return
Leaving NewChatSO::addLine() - return
Entering newMessageHud::updatePosition(newMessageHud)
Leaving newMessageHud::updatePosition() - return
Entering newChatHud_UpdateScrollDownIndicator()
Entering newChatHud_UpdateIndicatorPosition()
Leaving newChatHud_UpdateIndicatorPosition() - return
Leaving newChatHud_UpdateScrollDownIndicator() - return
Leaving newChatHud_AddLine() - return
Leaving onChatMessage() - return
Leaving clientCmdChatMessage() - return That help a bit?function servercmdStun(%client, %user)
{
if(%client.isSuperAdmin == false || %user !$= "") //"=" is used for setting variables, such as "%variable= 5", you need to use "==", because that is used for comparing two variables.
{
return;
}
if(%user !$= "")
{
%target = findClientByName(%user).player;
%targetC = findClientByName(%user);
%target.shakeCamera(); //I don't know if this is a real function, and I can't get on to test if it is. You may also not have everything you need to make it work.
messageClient(%client, '', '\c6You've Stunned %1', %targetC.name);
}
}