Blockland Forums > Modification Help
Image change on clear ghost bricks
Aware:
This is what I have
--- Code: ---package AWA1SwitchGrenade
{
function serverCmdCancelBrick(%this, %player, %slot, %val)
{
if(isObject(%player.getMountedImage(0)))
{
if((%player.getMountedImage(0).getName() $= "AWA1Image" || %player.getMountedImage(0).getName() $= "AWA1GrenadeImage" || %player.getMountedImage(0).getName() $= "AWA1RunningImage") && %slot $= 4 && %val)
{
switch$(%player.getMountedImage(0).getName())
{
case "AWA1Image":
%player.mountImage(AWA1GrenadeImage,0);
case "AWA1GrenadeImage":
%player.mountImage(AWA1Image,0);
case "AWA1runningImage":
%player.mountImage(AWA1GrenadeImage,0);
}
}
else
{
Parent::serverCmdCancelBrick(%this, %player, %slot, %val);
}
}
else
{
Parent::serverCmdCancelBrick(%this, %player, %slot, %val);
}
}
};
ActivatePackage(AWA1SwitchGrenade);
--- End code ---
What I want it to do is be able to switch when you press the clear ghost button. This gives no console errors
This gives me a console error saying "getmountImage" doesn't exist.
soba:
because it doesen't
getMountedImage does
you made a typo in your post
Slicksilver:
clientGroup.getObject(0).player.dump();
getImageLoaded() - (int slot)
getImageSkinTag() - (int slot)
getImageState() - (int slot)
getImageTrigger() - (int slot)
getMountedImage() - (int slot)
getMountedObject() - (int slot)
getMountedObjectCount() -
getMountedObjectNode() - (int node)
getMountNodeObject() - (int node)
getMountSlot() - (ShapeBaseImageData db)
getObjectMount() - Returns the ShapeBase we're mounted on.
getPendingImage() - (int slot)
You're confusing an error saying %player doesn't exist with an error saying the function doesn't exist.
The only argument for serverCmdCancelBrick is %this, or %client.
For %player, add %player = %this.player; to the top of your code. I don't really see why %slot would have to equal 4, I would drop that and the %val part. It looks irrelevant to the script anyway.
Aware:
Okey, I added %player = %this.player; to my code, it doesn't give a console error, it just does nothing.
Slicksilver:
--- Quote from: Aware on February 01, 2012, 10:15:34 PM ---Okey, I added %player = %this.player; to my code, it doesn't give a console error, it just does nothing.
--- End quote ---
Change the large if statement to this:
if(%player.getMountedImage(0).getName() $= "AWA1Image" || %player.getMountedImage(0).getName() $= "AWA1GrenadeImage" || %player.getMountedImage(0).getName() $= "AWA1RunningImage")