Author Topic: Changing a certain value and re exec-ing  (Read 2615 times)

Would it be possible to make a script so that you could type some like: /setballtime 15, and that would change lifetime = 50.0; to lifetime = 15.0; in weapon_ballinator then re exec it? Cause it would be nice if you could set how long it takes for them to disappear.

Dont know if this would work:

Code: [Select]
//all stuff about weapon
lifetime = $ballTime;
//all the other stuff

serverCmdsetBallTime(%client, %t1){
    $ballTime = %t1;
}

Try it. It MIght not work or it might work dunno.

serverCmdsetBallTime(%client, %t1){
    *name of ball projectile*.lifetime = %t1;
}

Neither of those work, I just get "unknown command: serverCmdSetBallType".


Execing what? If you mean the .cs with the serverCmd, when I exec it in game it gives errors in the console.


Entered /setballtime 3 in the chat and then exec'd it.

Code: [Select]
serverCmdsetballtime: Unknown command.
keyboard0 input device unacquired.
==>exec("add-ons/vh_ballscripts.cs");
Add-Ons/VH_Ballscripts.cs Line: 1 - Syntax error.
>>> Advanced script error report.  Line 1.
>>> Some error context, with ## on sides of error halt:
serverCmdsetBallTime(%client, %t1){##
##
^ballinator.lifetime = %t1;

}


>>> Error report complete.

Executing Add-Ons/VH_Ballscripts.cs.
Add-Ons/VH_Ballscripts.cs Line: 1 - Syntax error.
>>> Advanced script error report.  Line 1.
>>> Some error context, with ## on sides of error halt:
serverCmdsetBallTime(%client, %t1){##
##
^ballinator.lifetime = %t1;

}


>>> Error report complete.

Well Rudy's gives no errors, but it still doesn't change the lifetime of the ball.

You see, here
Code: [Select]
//shell
datablock DebrisData(ballinatorShellDebris)
{
shapeFile = "add-ons/shapes/ball.dts";
lifetime = 50.0;
minSpinSpeed = -400.0;
maxSpinSpeed = 900.0;
elasticity = 1.0;
friction = 0.2;
numBounces = 100000;
staticOnMaxBounce = false;
snapOnMaxBounce = false;
fade = true;

gravModifier = 2.5;
};

I need the lifetime = 50.0; bit changeable via chat.

serverCmdsetBallTime(%client, %t1){
    ballinatorShellDebris.lifetim e = %t1;
}

Quote
Neither of those work, I just get "unknown command: serverCmdSetBallType".
The servercommand is "setBallTime" not "setBallType". So, type /setballtime 8000 in chat for 8 seconds lifetime.

function serverCmdsetBallTime(%client, %t1){
    ballinatorShellDebris.lifetim e = %t1;
}

Quote
Neither of those work, I just get "unknown command: serverCmdSetBallType".
The servercommand is "setBallTime" not "setBallType". So, type /setballtime 8000 in chat for 8 seconds lifetime.

It works now, thanks a ton you guys!

You look like your progressing well VH.

* Rolland falls back crying
rudyman's going to be banned for grammar national socialist'ing
* Rolland continues to cry