Amm, I have another problem here, it's something really simple (maybe), but I can't get it working:
I'm making a sniper scope zoom too, it's a little bit different:
When you click once , it zooms, when you release the mouse, it doesn't unzoom, than when you click again it zooms even more, and than if you click one more time, it uznooms. I got it working, but I got a little
speed problem, that I'm trying to slow down.If I click and hold the right mouse button, the zooming states will start cycling really fast (each one on the next frame), so I decided that I can make a variable, that decreases by 1 every frame, and than if it's value is equal or smaller than zero, the next zoom state will get triggered if the player presses the R mouse button. Now I'm not sure if this is a good idea (the one with the variable), because the variable will keep decreasing every frame, and dunno...it may cause the game to crash...or... dunno, but the fact is that it's not working, when I cklick the right mouse button for the first time, it zooms and than nevermind what I do, nothing changes, even if I switch the weapon...so the script stops somewhere, but what's stopping it?
Code: Select all
if (IsKeyDown(73) and (self.player_weapon = 6))
{
zoomagain = 10000;
self.think = "sniperzoom";
}
} ]
sniperzoom[ ()
{
zoomagain = zoomagain - 1;
DrawFlipBookImage("sniperscope",0,0,0,200,255,255,255,1);
SetCameraWindow(0.4);
if (IsKeyDown(73) and (zoomagain <= 0))
{
zoomagain = 10000;
self.think = "andagain";
}
} ]
andagain[ ()
{
zoomagain = zoomagain - 1;
DrawFlipBookImage("sniperscope",0,0,0,200,255,255,255,1);
SetCameraWindow(0.1);
if (IsKeyDown(73) and (zoomagain <= 0))
{
zoomagain = 10000;
SetHudDraw(true);
SetCameraWindow(2);
HighLevel("Spawn");
}
} ]