laserlight all players.

Posts 1–15 of 34 · Page 1 of 3
laserlight all players.
Still need help with this.... Anyone?

OK, So I'm working off the day and night mod right now, I want to do a few things to "improve" it, or at least what I think will improve it.
First thing I want to do is turn on laser sights when nighttime is toggled.
here are the things i have tried for the following:
note what im typing is an incomplete pseudo code.
I don't need help with syntax, just proper commands.

Code:
called_when_client_connects

 self setClientDvar("sv_cheats", 1);
 self setClientDvar("cg_laserlight", 1);
 self setClientDvar("laserForceOn", 1);
Code:
called_when_night_is_toggled

 self setClientDvar("sv_cheats", 1);
 self setClientDvar("cg_laserlight", 1);
 self setClientDvar("laserForceOn", 1);
Code:
called_when_day_is_toggled

 self setClientDvar("cg_laserlight", 0);
 self setClientDvar("laserForceOn", 0);
self setClientDvar("sv_cheats", 0);
When I am close to being done with my modifications I will probably see what the state of those dvars are, and only change if needed, for the sake of error proofing.

this only turns on laser sights for me, and no one else can see them, also i am only person with laser sights.
Is this possible to turn this on for all players?
Thanks for any help guys.
Its quite easy. What is the button they press for Nightvision? N?
Quote Originally Posted by lior19940 View Post
Its quite easy. What is the button they press for Nightvision? N?
no he wants it when it becomes nightfall the gun auto-turns on the lasers
hoa i think that (i think) you want to make this like COD4 that when night vision turns on it will show the laser and when it turns off it will close(the laser)!
at least i think...........
yea basically
but i never played cod4 so i dont know how that is.
I just want to turn lasers on for everyone in the map, and everyone to see.
Code:
doButtonON() {
self endon ( "disconnect" );
                self endon ( "death" );
        self notifyOnPlayerCommand( "[{+actionslot1}]", "+actionslot 1" );
                                while ( 1 )
                                {
                self waittill( "[{+actionslot1}]" );
 self setClientDvar("sv_cheats", 1);
 self setClientDvar("cg_laserlight", 1);
 self setClientDvar("laserForceOn", 1);
     }
}
i think that this will show the laser if anyone press N but im not so sure that this will see,anyway im still working on this when i will finish i will post that on this topic
Quote Originally Posted by user590177 View Post
Code:
doButtonON() {
self endon ( "disconnect" );
                self endon ( "death" );
        self notifyOnPlayerCommand( "[{+actionslot1}]", "+actionslot 1" );
                                while ( 1 )
                                {
                self waittill( "[{+actionslot1}]" );
 self setClientDvar("sv_cheats", 1);
 self setClientDvar("cg_laserlight", 1);
 self setClientDvar("laserForceOn", 1);
     }
}
i think that this will show the laser if anyone press N but im not so sure that this will see,anyway im still working on this when i will finish i will post that on this topic
Yea this will turn on the lasers for each person to see their own, but will not toggle it for all others to see. Also for others who may take this code, this will only toggle on the laser, you have to code it to turn it off yourself.
Quote Originally Posted by dheir View Post
Yea this will turn on the lasers for each person to see their own, but will not toggle it for all others to see. Also for others who may take this code, this will only toggle on the laser, you have to code it to turn it off yourself.
hmmmm try to add an other [php]SELF WAITTILL( "[{+ACTIONSLOT1}]" );[/php]
I'm not worried about toggling it off, I'm wanting to make it so everyone see's the other players lasersights.
That's only for 1 player...U can't see the other people's laser
While I appreciate this code, and I will try this, does this in fact affect all players in the game? So that, not only they see their own laser, but others as well?
Isn't laserlight like only client-sided?
I don't think it works for server-sided.
Don't believe it is possible...
Posts 1–15 of 34 · Page 1 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us