UGX-Mods

Call of Duty 5: World at War => Help Desk => Topic started by: DeletedUser on August 23, 2016, 06:50:27 pm

Title: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 06:50:27 pm
So how i enable the cg_laserForceOn on a certain weapon and it's always active in game?
Any help is appreciate. :)
Title: Re: Laser Sight Attachment
Post by: BluntStuffy on August 23, 2016, 06:59:55 pm
Code Snippet
Plaintext
laser()
{
while(1)
{
if(self getcureentweapon() == "zombie_colt" )
{
self setClientDvar( "cg_laserForceOn", 1 );
}
else
{
self setClientDvar( "cg_laserForceOn", 0 );
}
wait .2;
}
}


Title: Re: Laser Sight Attachment
Post by: HitmanVere on August 23, 2016, 07:01:42 pm
Code Snippet
Plaintext
laser()
{
while(1)
{
if(self getcureentweapon() == "zombie_colt" )
{
self setClientDvar( "cg_laserForceOn", 1 );
}
else
{
self setClientDvar( "cg_laserForceOn", 0 );
}
wait .2;
}
}



getcurrentweapon()* Just in case you didnt notice that and to save OP with one less bad syntax error :)
Title: Re: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 07:14:05 pm
Code Snippet
Plaintext
laser()
{
while(1)
{
if(self getcureentweapon() == "zombie_colt" )
{
self setClientDvar( "cg_laserForceOn", 1 );
}
else
{
self setClientDvar( "cg_laserForceOn", 0 );
}
wait .2;
}
}


Spoiler: click to open...
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimage.prntscr.com%2Fimage%2Ffb181a03c04746659ff754845feb7db2.jpg&hash=ddc4df2d2acb46c93afd243ba7c28eb4fe50d5d2)
Title: Re: Laser Sight Attachment
Post by: HitmanVere on August 23, 2016, 07:18:54 pm
Spoiler: click to open...
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fimage.prntscr.com%2Fimage%2Ffb181a03c04746659ff754845feb7db2.jpg&hash=ddc4df2d2acb46c93afd243ba7c28eb4fe50d5d2)

Show how you put in the script in new .gsc
Title: Re: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 07:20:41 pm
Show how you put in the script in new .gsc
Spoiler: click to open...
(https://gyazo.com/64dad748db10b3bb8acca6bae381df87.jpg)
Title: Re: Laser Sight Attachment
Post by: HitmanVere on August 23, 2016, 07:22:22 pm
Spoiler: click to open...
(https://gyazo.com/64dad748db10b3bb8acca6bae381df87.jpg)

Show the actual script
Title: Re: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 07:23:43 pm
Show the actual script
Spoiler: click to open...
(https://gyazo.com/055dedd65fa12cc7a64462c7b9ddf692.jpg)
Title: Re: Laser Sight Attachment
Post by: HitmanVere on August 23, 2016, 07:25:33 pm
Spoiler: click to open...
(https://gyazo.com/055dedd65fa12cc7a64462c7b9ddf692.jpg)

Thats where your issue is. Change laser() to init() and add this on top of the script:

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
Title: Re: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 07:29:44 pm
Thats where your issue is. Change laser() to init() and add this on top of the script:

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
there's a problem now, the round wont start.
Title: Re: Laser Sight Attachment
Post by: HitmanVere on August 23, 2016, 07:32:44 pm
there's a problem now, the round wont start.

Oh yeah, the whole thing isnt even threaded on players :facepalm2:
Title: Re: Laser Sight Attachment
Post by: BluntStuffy on August 23, 2016, 07:33:00 pm
You need to cll it on the players,  so add a function that gets the players and thread this function on each one of them. On my phone now but sure someone can help
Title: Re: Laser Sight Attachment
Post by: DeletedUser on August 23, 2016, 07:42:23 pm
Fixed the round thing but there's no laser on the pistol. :(

EDIT: Fixed... the laser it works!

Thank you Stuffy, Hitman & X0master  :)