Author Topic: Problem with changing fov in gun firing  (Read 681 times)

Most of you will say "ew" when you see the code

Code: [Select]
function gunImage::onFire(%this,%obj,%slot)
{
       schedule(5,setfov(91));
       schedule(10,setfov(92));
       schedule(15,setfov(93));
       schedule(20,setfov(94));
       schedule(25,setfov(95));
       schedule(30,setfov(94));
       schedule(35,setfov(93));
       schedule(40,setfov(92));
       schedule(45,setfov(91));
       schedule(50,setfov(90));
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, shiftAway);
Parent::onFire(%this,%obj,%slot);
}

I set it to change the fov when the gun is fired, inspired by the dynamic fov mod recently created. The console tells me this:

Quote from: Console
Add-Ons/Weapon_FovGun/server.cs (387): Call to setFov in onFire uses result of void function call.

Can someone help (or give a better suggestion on how to do this?)

It seems onFire isn't a valid function. try onactivate or something.

I don't even know lol.

It seems onFire isn't a valid function. try onactivate or something.

I don't even know lol.

Of course onFire is a valid function, it is packaged with every gun known to blockland

setFov is a client-sided function, not to mention you're using schedule wrong.

Use %obj.schedule(delay, "setCameraFOV", fov);.

SetFOV is a client sided functiom.

didnt see port's post....