Alright bit of a back story before i begin; for the record i am an idiot when it comes to coding languages and how they work and im slowly learning, so as this is an issue that i would really love to get resolved soon im going to ask for a little spoon feeding, but at the same time id enjoy if you took a little bit of time to walk me through stuff or show me how it works ect for the future.
Annnnyways
Basically whats going on is that the coding template that im using, courtesy of NEKram, sets FOV to 90 or whatever i specify in the code. Now in the code i can alter FOV for magnified optics, but when you unmount the optic image i have to set the FOV back to specific value.
What i want to do is be able to get the players default FOV and set it back to that FOV value when the player unmounts the optic image.
Heres what i use now:
package AK74MSights
{
function armor::onTrigger(%this,%obj,%triggerNum,%val)
{
%client = %obj.client;
if(%obj.getMountedImage(0) $= AK74MImage.getID() && %triggerNum == 4 && %val)
{
%newAmmo = %obj.toolAmmo[%obj.currTool];
%obj.mountImage(AK74MSCImage, 0);
%client.setControlCameraFov(80);
%obj.toolAmmo[%obj.currTool] = %newAmmo;
}
else if(%triggerNum == 4 && %obj.getMountedImage(0) $= AK74MSCImage.getID() && %val)
{
%newAmmo = %obj.toolAmmo[%obj.currTool];
%obj.mountImage(AK74MImage, 0);
%client.setControlCameraFov(90);
%obj.toolAmmo[%obj.currTool] = %newAmmo;
}
Parent::onTrigger(%this,%obj,%triggerNum,%val);
}
function servercmdDropTool(%client,%slot)
{
if(%client.player.getMountedImage(0) $= AK74MSCImage.getID())
{
%client.player.unmountImage(0);
%client.setControlCameraFov(90);
if($BKT::CH)
{
crossHair.setBitmap("base/client/ui/crosshair.png");
}
}
return Parent::servercmdDropTool(%client,%slot);
}
};
activatePackage(AK74MSights);
function AK74MSCImage::onMount(%this, %obj, %slot, %client)
{
%obj.client.setControlCameraFov(80);
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:FF0000>||| <font:impact:34>\c6" @ %obj.toolAmmo[%obj.currTool]+0 @ " / " @ %obj.client.quantity["AmmoMedium"]+0 @ "", 4, 2, 3, 4);
}
function AK74MSCImage::onUnMount(%this, %obj, %slot, %client)
{
%obj.client.setControlCameraFov(90);
}
I would be very appreciative if you guys could solve this for me and possibly teach me a few things as well. Bare with me and thanks in advance.