Blockland Forums > Modification Help

Setting player velocity? [Resolved]

Pages: << < (4/4)

FrogFreak:

I'll give that a shot.

Headcrab Zombie:

Perhaps you could actually post your code?

Slicksilver:


--- Quote from: Jasa1 on February 19, 2012, 09:22:59 PM ---addvelocity("0 0 0"); does nothing.
setvelocity("0 0 0"); freezes the player for a second.

--- End quote ---
Uh, yeah. That's what setting their velocity to 0 does. Adding 0 velocity to someone wouldn't do anything, but making their velocity 0 would stop them until gravity or movement took hold. I don't see the problem.

FrogFreak:


--- Quote from: Headcrab Zombie on February 19, 2012, 10:12:11 PM ---Perhaps you could actually post your code?

--- End quote ---

These are the two code snippets that I'm wanting the velocity to be modified in.

--- Code: ---function VulcanDeployedImage::onMount(%this,%obj,%slot)
{
   Parent::onMount(%this,%obj,%slot);
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>7.08 Heavy Rifle <font:impact:34>\c6" @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["708rounds"] @ "", 4, 2, 3, 4);
%obj.pushDatablock(PlayerDeployedArmor.getID());
%obj.playThread(2, ArmReadyBoth);
%player.setVelocity = ("0 0 0");  // Faulty Line
}

--- End code ---


--- Code: --- package VulcanDeploying
{
   function Armor::onTrigger(%this, %player, %slot, %val)
{
if(%player.getMountedImage(0) $= VulcanImage.getID() && %slot $= 4 && %val)
{
if ($Pref::Server::VulcanDeploy == 1){
 %player.mountImage(VulcanDeployedImage,0);
 %player.pushDatablock(PlayerDeployedArmor.getID());
 %player.setVelocity = ("0 0 0"); // Faulty Line
 }
}    

else if(%player.getMountedImage(0) $= VulcanDeployedImage.getID() && %slot $= 4 && %val)
{
 %player.mountImage(VulcanImage,0);
 %player.popDatablock(PlayerDeployedArmor.getID());
}
Parent::onTrigger(%this, %player, %slot, %val);
}

function servercmdDropTool(%client,%slot)
{
if(%client.player.getMountedImage(0) $= VulcanDeployedImage.getID())
{
 %client.player.unmountImage(0);
 %player.popDatablock(PlayerDeployedArmor.getID());
}
return Parent::servercmdDropTool(%client,%slot);
}

};
ActivatePackage(VulcanDeploying);
--- End code ---


FrogFreak:

OH Derp, Froggy needs reading lessons.

I kept overlooking that you guys used setvelocity("0 0 0");. I have been trying setvelocity = ("0 0 0");.

:S


Problem solved. I was using the code incorrectly. The code works now, now that I've actually noticed what I'm supposed to be typing.  Thanks for your help guys.

Remember kids, reading helps!

Pages: << < (4/4)

Go to full version