Does anyone have a mod that turn of Crosshair when running?
Moderator: Moderators
Does anyone have a mod that turn of Crosshair when running?
Im working on an ultimate realism mod for mohaa, now my big problem is the aiming system, considering noone make ironsights and i think noone will, IS THERE A WAY TO TURN OFF CROSSHAIR WHEN RUNNING (Server side)??? 
- Clackinizer
- Sergeant
- Posts: 72
- Joined: Sun Mar 16, 2003 1:49 am
- Location: USA
- Contact:
- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
I know another way, but I think it'll be hard to implement.
Here is the syntaxis to turn off a player's crosshair:
$player[#] weaponcommand dual dmcrosshair 0
And to turn it on again:
$player[#] weaponcommand dual dmcrosshair 1
To find out whether a player is running:
if(($player[#] getmovement)[0] == r) // r-unning
I hope this will help you somehow.
Here is the syntaxis to turn off a player's crosshair:
$player[#] weaponcommand dual dmcrosshair 0
And to turn it on again:
$player[#] weaponcommand dual dmcrosshair 1
To find out whether a player is running:
if(($player[#] getmovement)[0] == r) // r-unning
I hope this will help you somehow.
- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
So this should do it?
Code: Select all
while(1)
{
wait .1
for(local.p = 1; local.p < $player.size+1;local.p++)
{
if($player != NULL && $player[local.p].dmteam != "spectator" && $player[local.p].health > 0 && ($player[local.p] getmovement)[0] == r)
{
$player[local.p] weaponcommand dual dmcrosshair 0
}
else
{
$player[local.p] weaponcommand dual dmcrosshair 1
}
}
wait (.5)
}
end- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
lol It was supposed to work, but I tested it and it did not. The problem lies in the weaponcommand dual crosshair 1. It just does not work for me.
So I substituted it with the yucky stufftext and it worked.
This is what my script looked like:
While it works, I do not like the idea of stuffing text at this rate. So I hope we can sort out the right command.
So I substituted it with the yucky stufftext and it worked.
This is what my script looked like:
Code: Select all
_running:
while(1)
{
for(local.p = 1; local.p < $player.size+1;local.p++)
{
if($player != NULL && $player[local.p].dmteam != "spectator" && $player[local.p].health > 0 && ($player[local.p] getmovement)[0] == r)
{
$player[local.p] stufftext ("ui_crosshair 0")
}
else
{
$player[local.p] stufftext ("ui_crosshair 1")
}
}
wait (.1)
}
endHmm I did some tests and the crosshair and dmcrosshair commands seem to be total nonsense. For example, the m2_frag_grenade_base.txt file specifies no crosshair for nades but still the game draws one.
Looks like the stufftext command is the only possible way, although I yet know a method to hack around this mod (and thus use a crosshair after all).
Looks like the stufftext command is the only possible way, although I yet know a method to hack around this mod (and thus use a crosshair after all).
- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
-
Hashmark13
- Major
- Posts: 299
- Joined: Mon Nov 25, 2002 12:20 am
- Location: USA
You probably dont remember me.. but im back :P
The only problem i am having is trying to figure out where exactly to implement this script.
" If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside."
- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
Re: You probably dont remember me.. but im back :P
Then you got no problemHashmark13 wrote:The only problem i am having is trying to figure out where exactly to implement this script.
Make a script file (no_crosshair.scr) and put this inside:
Code: Select all
main:
level waittill spawn
_running:
while(1)
{
for(local.p = 1; local.p < $player.size+1;local.p++)
{
if($player != NULL && $player[local.p].dmteam != "spectator" && $player[local.p].health > 0 && ($player[local.p] getmovement)[0] == r)
{
$player[local.p] weaponcommand dual crosshair 0
}
else
{
$player[local.p] weaponcommand dual crosshair 1
}
}
wait (.1)
}
endCode: Select all
exec global/no_crosshair.scr::mainAs you can see I got the weaponcommand to work. I figured it out because when I checked the server file, I found no instances of "dmcrosshair". Buy me a beer JV. I like Colt.
Last edited by The Jackal on Sat Sep 27, 2003 9:34 pm, edited 1 time in total.
- The Jackal
- Sergeant Major
- Posts: 101
- Joined: Wed May 07, 2003 10:09 am
- Contact:
