Page 1 of 1
Does anyone have a mod that turn of Crosshair when running?
Posted: Mon Sep 22, 2003 1:00 am
by MrOblongo
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)???

Posted: Mon Sep 22, 2003 2:53 am
by Clackinizer
i know it'd have something to do with binding the keys to when you move it kills the crosshair... but i have no talent at scripting.. sorry

Posted: Thu Sep 25, 2003 6:07 am
by The Jackal
Only thing I can think off is the STUFFTEXT command.
Kinda like run a thread to check to see when a player is moving and stuff the ui_crosshair command if true.

Posted: Thu Sep 25, 2003 4:13 pm
by jv_map
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.
Posted: Thu Sep 25, 2003 8:05 pm
by The Jackal
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
Posted: Fri Sep 26, 2003 6:05 am
by jv_map
Could try that

Posted: Sat Sep 27, 2003 2:35 am
by MrOblongo
Does it works?, i tested it (maybe i dont know where to put it), and it diditn worked

Posted: Sat Sep 27, 2003 5:48 am
by The Jackal
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:
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)
}
end
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.
Posted: Sat Sep 27, 2003 7:55 am
by jv_map
Hmm 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).
Posted: Sat Sep 27, 2003 3:02 pm
by The Jackal
HEHEH JV. I thought of that. But not alot of people know to do it.
And I do not think forums like these should discuss them either.
Posted: Sat Sep 27, 2003 8:37 pm
by MrOblongo
How u make that work

???
You probably dont remember me.. but im back :P
Posted: Sat Sep 27, 2003 8:49 pm
by Hashmark13
The only problem i am having is trying to figure out where exactly to implement this script.
Re: You probably dont remember me.. but im back :P
Posted: Sat Sep 27, 2003 9:05 pm
by The Jackal
Hashmark13 wrote:The only problem i am having is trying to figure out where exactly to implement this script.
Then you got no problem
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)
}
end
Then open the map script file and type this below "level waittill spawn":
Code: Select all
exec global/no_crosshair.scr::main
Pack those two files in a PK3 - using the right paths - and you are a go!
As 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.

Posted: Sat Sep 27, 2003 9:07 pm
by The Jackal
MrOblongo wrote:How u make that work

???
It's pretty easy. All you gotta do is ....[(*^(*^%&)((*^*&^)(&]
Moderator: This post contained trade secrets. DELETED secret!

Posted: Sat Sep 27, 2003 9:48 pm
by MrOblongo
THX THX THX, that works and now im happy
