FORCE316 | Crosshair Control Mod (server-side script) - A No Crosshairs Mod for Call of Duty United Offensive (CODUO)
A server-side script that removes all players crosshairs when the mod is activated by a cvar. This script was designed so that when the crosshair removal is not enforced the user is not forced to use the crosshairs but they are able to choose to deactivate them if they still wish to.
Greetings CODers,
I have not been gaming for quite some time now but I happened across this file on my computer and thought that some of you may like to have it. I hate crosshairs more then anything in first person shooters. Once you play without them you will never want to see them again. They are ugly and distracting. Without them you will spot your enemies quicker and maintain a greater situational awareness.
I don't have COD installed right now so I can't build and test a server side pk3 but I will do the next best thing and give you some step by step instructions for creating or altering a server side mod for your server. This may be even better then a pk3 file because if your server is already modded then you can implement this without having to worry about mod conflicts.
I am quite proud of this script. The beauty of this script mod is that you can choose to enforce no crosshairs but when you turn enforcement off the players still have the ability to choose to disable them if they want. They are not forced to use them. Enforcement is only one way. Most crosshair enforcement scripts either force you to have them on or off. This way if you are a pro then you can still play without them even if the rest have them on. This script has a redundancy built in so that one, you dont see the crosshairs for that short time even if you enable them. Two, because of the redundant system you don't have to send out the client side command as often, thereby reducing any issues that may crop up in relation to setting of client side variables. Three, you don't see the crosshairs for that short duration when you first start playing.
Note: Because this mod uses a cvar to activate/deactivate the mod and the cvar is checked each time the player is spawned the admin can activate/deactivate the mod without having to restart the server or map. For deactivation it may take until the next death for the mod to come into effect but thats hardly a big deal.
1. Create a text file and rename it _f316_xhairs.gsc.
Create this directory tree and place the file in it - "maps\mp\_f316_xhairs.gsc"
Open "_f316_xhairs.gsc" and Copy & Paste this script into it -
// ----------------------------------------------------------------------------------
// FORCE316 CROSSHAIR CONTROL
//
// Disables And Enables Crosshairs but doesn't interfere with users choice when xhairs are on
// ----------------------------------------------------------------------------------
// FORCE316 SCRIPT BY GOSHAWK :: Please visit www.freewebs.com/cod-force316
no_xhairs()
{
self endon ("round_ended");
self endon ("end_respawn");
self endon ("spawned");
self endon ("death");
ch316_var = 0;
if (getcvar("scr_f316_no_xhairs") == "1")
{
while(ch316_var == "0")
{
self setClientCvar("cg_drawcrosshair", "0");
wait 30;
ch316_var=0;
if (getcvar("scr_f316_no_xhairs") == "0")
{
self setClientCvar("cg_drawcrosshair", "1");
ch316_var=1;
}
}
wait 2;
}
if (getcvar("scr_f316_no_xhairs") == "0")
{
self setClientCvar("cg_crosshairAlpha", "1");
}
}
// END FORCE316 SCRIPT :: Please visit www.freewebs.com/cod-force316
2. Copy your "maps\mp\gametypes\bas.gsc" (or whatever gametype you are going to be playing.) to the mod you are building.
You will need to make these adjustment to all of your gametype gsc files. Be sure to maintain the file folder structure. ie. "maps\mp\gametypes\"
2a. In "SpawnPlayer()" add the following line of script to the gametype.gsc. It should be at the end of "SpawnPlayer()" within the brackets. Not the round brackets... the squigley ones!!!!
// Added by FORCE316
self thread maps\mp\_f316_xhairs::no_xhairs();
2b. In "Callback_PlayerConnect()" area copy following script into the brackets. Not the round brackets... the squigley ones!!!!
Keep the "Added by FORCE316" comments as this will make it easier to find in the future.
Add after the line - " logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");"
// Added by FORCE316
self setClientCvar("cg_crosshairAlpha", "0");
3. Add this stuff to your existing server side mods or if you don't have any mods create a new pk3 called "zzz_svr_f316xhairs.pk3" and add your files to them. Make sure you maintain the proper directories. ie. "maps\mp\_f316_xhairs.gsc"
4. upload your mod to your server.
5. Add the following cvar to your server's config file. I can't remember the syntax.
scr_f316_no_xhairs = 1
or
scr f316_no_xhairs = 1
If the cvar is set to "1" then my crosshairs system will be enforced. If set to "0" the players will have the choice to play with our without. This script has been thoroughly tested with perfect results.