Release FOV Plugin
#1
Hello guys

This is my fov plugin. Every player can change his fov to a number between 65 - 90.
Example: !fov 80
Requires @Nukem's dedicated server addon V1.190+

Source:
Code:
using System; using Addon; namespace MW3_FOV { public class zxz_FOVPlugin : CPlugin { public override void OnServerLoad() { ServerPrint("\n FOV Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh\n"); } public override ChatType OnSay(string Message, ServerClient Client) { if (Message.StartsWith("!fov")) { string[] split = Message.Split(' '); try { int num; bool isNum = int.TryParse(split[1], out num); if (split.Length == 2 && isNum) { if (Convert.ToInt32(split[1]) <= 90 && Convert.ToInt32(split[1]) >= 65) { if (Convert.ToInt32(split[1]) <= 90 && Convert.ToInt32(split[1]) > 80) { Int32 fov = Convert.ToInt32(split[1]); float fovscale = (float)fov / 80; SetClientDvar(Client.ClientNum, "cg_fov \" 80 \""); SetClientDvar(Client.ClientNum, "cg_fovscale \"" + fovscale + "\""); } else { SetClientDvar(Client.ClientNum, "cg_fov \"" + split[1] + "\""); SetClientDvar(Client.ClientNum, "cg_fovscale \"1\""); } TellClient(Client.ClientNum, "PM: FOV changed to " + split[1] + ", default value is 65", true); } else TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true); return ChatType.ChatNone; } } catch { } TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true); return ChatType.ChatNone; } return ChatType.ChatContinue; } } }

Thanks zxz...


Attached Files
.zip   MW3_FOVPlugin.zip (Size: 2.29 KB / Downloads: 545)
[Image: azuw.jpg]
Reply

#2
Chicken
Reply

#3
It will always tell the player that its invalid coz its outside the catch brackets Wink
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#4
(01-06-2012, 12:14)iAegle Wrote: It will always tell the player that its invalid coz its outside the catch brackets Wink

[Image: nope.avi.jpg]
Try it.
[Image: azuw.jpg]
Reply

#5
Very brave
[Image: MaEIQ.png]
Reply

#6
Well, i'd rather have one that's always activated without using chatcommands, but okay, here you go
Reply

#7
(01-06-2012, 13:14)jariz Wrote: Well, i'd rather have one that's always activated without using chatcommands, but okay, here you go

You only need to type it once and besides not everyone likes fov 90. Your plugin doesn't work btw.
[Image: azuw.jpg]
Reply

#8
noshit sherlock
Reply

#9
how activateit without using chatcommands ?
dprclan.com ,, we are recruiting for black ops 2 !! join us soldier Cool
Reply

#10
This does not work correctly, when you use the command it changes the FOV, however it also changes so when you ADS it does not zoom in. This is a problem with snipers. I think its because you used cg_fovmin instead of cg_fov.

EDIT: Just tested, this is a edited properly working version:

Code:
using System; using Addon; namespace MW3_FOV { public class zxz_FOVPlugin : CPlugin { public override void OnServerLoad() { ServerPrint("\n FOV Plugin loaded \n Author: zxz0O0 \n Thanks to Nukem, Jariz, Pozzuh\n"); } public override ChatType OnSay(string Message, ServerClient Client) { if (Message.StartsWith("!fov")) { string[] split = Message.Split(' '); try { int num; bool isNum = int.TryParse(split[1], out num); if (split.Length == 2 && isNum) { if (Convert.ToInt32(split[1]) <= 90 && Convert.ToInt32(split[1]) >= 65) { SetClientDvar(Client.ClientNum, "cg_fov \"" + split[1] + "\""); TellClient(Client.ClientNum, "PM: FOV changed to " + split[1] + ", default value is 65", true); } else TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true); return ChatType.ChatNone; } } catch { } TellClient(Client.ClientNum, "PM: Invalid parameter. Usage: !fov <fov 65-90>", true); return ChatType.ChatNone; } return ChatType.ChatAll; } } }
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Rainbow [Release] Plugin ReservedSlot v1.3 frst_ 1 4,996 11-08-2018, 19:17
Last Post: frst_
Tongue [Release] MW3 Shop plugin Dude 56 51,306 03-25-2018, 05:18
Last Post: [email protected]
  [Release] Permission plugin Pozzuh 202 163,926 05-01-2017, 15:41
Last Post: W4R||The Hyper
  [Release] FIXED SPEED PLUGIN hillbilly 2 5,656 06-02-2016, 20:23
Last Post: clacki
  [Release] Bots Plugin For Users Casper 22 39,856 08-22-2015, 17:45
Last Post: SnapBacks
  [Release] God Plugin v5.0 [Ingame Rcon Tool] OzonE 464 335,837 06-27-2015, 15:38
Last Post: bluedot
  [Release] Anti Hardscope Plugin 8q4s8 26 27,596 06-20-2015, 22:44
Last Post: urj88419
  [Release] ProMod Plugin zxz0O0 875 761,649 03-25-2015, 22:02
Last Post: kris
  [Release] [Discontinued] Speed Plugin Pozzuh 164 121,965 10-06-2014, 12:56
Last Post: Nekochan
  [help]how create a ping plugin clacki 3 5,077 09-13-2014, 01:23
Last Post: clacki

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.