Author Topic: Setting player velocity? [Resolved]  (Read 1531 times)


Perhaps you could actually post your code?

addvelocity("0 0 0"); does nothing.
setvelocity("0 0 0"); freezes the player for a second.
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.

Perhaps you could actually post your code?

These are the two code snippets that I'm wanting the velocity to be modified in.
Code: [Select]
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
}

Code: [Select]
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);
« Last Edit: February 19, 2012, 11:35:38 PM by 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!
« Last Edit: February 19, 2012, 11:50:58 PM by FrogFreak »