AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Disable zoom on Awp (https://forums.alliedmods.net/showthread.php?t=55459)

Arkshine 05-22-2007 09:32

[Solved] Disable zoom on Awp
 
Hi,

Is there a way to disable zoom (x2 & x3) on awp please?

If it's possible, how ?


Thanks! :)


EDIT : ha. I think that I can use "cs_set_user_zoom()" function with CS_SET_NO_ZOOM. I'm testing.

regalis 05-22-2007 10:06

Re: Disable zoom on Awp
 
Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>

public plugin_init()
{
    register_event("SetFOV", "eventSetFOV", "b")
}

public eventSetFOV(id)
{
  client_print(id, print_chat, "* Your FOV is: %i", read_data(1));
  log_amx("zoomed");
  new ammo,clip;
  new WeaponNum = get_user_weapon(id, ammo, clip);
  if(WeaponNum == CSW_AWP)
  {
          log_amx("awp zoomed");
      message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id);
      write_byte(90);
      message_end();
  }
}

This works, have tested....weird!

Arkshine 05-22-2007 10:41

Re: Disable zoom on Awp
 
It works but you're still zoom even if you can't see zoom. (slow speed with FOV set to 40 / 10)

regalis 05-22-2007 10:45

Re: Disable zoom on Awp
 
maybe set player speed!?
set_user_maxspeed(id, 210.0)
That should do the trick ;)

Alka 05-22-2007 13:35

Re: Disable zoom on Awp
 
1 Attachment(s)
maybe this?:D

*Or you can make it in client_prethink()...and check if he have AWP set "No zoom" else return ! :wink: *

Later EDIT: Oh teame06...:/ ,i think you'r right! :P

teame06 05-22-2007 13:45

Re: Disable zoom on Awp
 
Quote:

Originally Posted by Alka (Post 479385)
maybe this?:D

*Or you can make it in client_prethink()...and check if he have AWP set "No zoom" else return ! :wink: *

I would hook CurWeapon. When they change to an awp set there zoom to CS_SET_NO_ZOOM. Once the weapon is change to another weapon than awp set reset it back to CS_RESET_ZOOM. So they can normally zoom on other weapons. Use an array see if they are set to no zoom or not on awp.

btw once they are set in CS_SET_NO_ZOOM they won't be able to change their zoom even if they change their weapon. Till you unset them

regalis 05-22-2007 14:14

Re: Disable zoom on Awp
 
What do you have against set_FOV? :(
Works fine for me :P

Arkshine 05-22-2007 14:36

Re: Disable zoom on Awp
 
Thanks Regalis, Alka, team06. ;)


All times are GMT -4. The time now is 10:43.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.