Weapon Lights * Update 0.7.1 Beta (26-Feb-2009)
4 Attachment(s)
New version 0.7.1 beta, attached donwload at the top of this post.
Hi, I was too busy sorry I can't add it before. New version done by Arkshine available. * Changes: - Fixed bug when using pistols. - Now uses VEN's method. * Download here v.0.6 (old bugged): Get Plugin Get Source * See here changes in new version: http://forums.alliedmods.net/showthr...676#post754676 - Features: This plungin just adds small dyanmic lights when a player shoot. You can also change the color and the radius of the lights. - Cvars: weapon_lights 0 -> disable 1 = enable, default 1 weapon_lights_radius -> the size of light, default 18 weapon_lights_color -> color of the light RGB 0-255, default 255 150 15 weapon_lights_silenced -> 0 = disable lights | 1 = normal light | 2 = 50% of a normal light, default 2 - Installation: Put .amxx file into your "./addons/amxx/plugins/" folder. Add "weapon_lights" into your "plugins.ini" file. ("./addons/configs/") - Credits: > Arkshine - adapted for using hamsandwich, VEN's method, silenced weapons option, code optimization and helped me a lot, thank you. > Avalanche (I learn there how to make a dynamic light, in his plugin "Flashbang Dynamic Light", used in first release). > HiSS - Original idea. It's me! - Modules recquired: * fakemeta * hamsandwich Tested in Counter-Strike 1.6 AMXX 1.8.1 and works fine. No reported issues with another plugin yet. Compiled with 0 errors | 0 warnings. Sorry for my bad english, I hope you enjoy the plugin. Greetings. |
Re: Weapon Lights (Beta) for Counter-Strike
As suggestions :
- Here it's more appropriate to use a command to retrieve the value or caching the value from cvar on a specific event ( like new_round ) ; because each time a player fires you retrieve the string and parse it when it needs to be done one time. ( one time when the value is changed ) - Since this function will be called very often, you should use static for light_origin. - MSG_BROADCAST -> You should use MSG_PVS ; no need to send the message to players who don't look the origin. - 27 -> Juste write directly TE_DLIGHT ; the define name is here for that. - Instead of using floatround(), use EngFunc_WriteCoord, it's for float. Better and you don't need to call 3 natives in more. - You include cstrike and fakemeta_util, no need here. |
Re: Weapon Lights (Beta) for Counter-Strike
screens?
|
Re: Weapon Lights (Beta) for Counter-Strike
Tested and works but still room for improvements.
http://forums.alliedmods.net/showthread.php?t=54887 You should read that so you can catch exactly when a shot is made. The way you have it is bad and sometimes plays when switching weapons. Anyway... Heres some screen shots [IMG]http://img88.**************/img88/6510/dedust20085vw7.jpg[/IMG] [IMG]http://img161.**************/img161/3557/dedust20088bb6.jpg[/IMG] [IMG]http://img440.**************/img440/6702/dedust20090me0.jpg[/IMG] |
Re: Weapon Lights (Beta) for Counter-Strike
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
I still trying to find the way how to detected if a weapon is silenced and make a cvar to turn on/off, żany suggestions? Thank you all for reply, and thank Mini_Midget for screenshots :) Greetings. |
Re: Weapon Lights (Beta) * Updated v0.2
seems fun. nive ak skins :D
|
Re: Weapon Lights (Beta) * Updated v0.2
I think you should make it so that when a silencer is used...have it so the light is not as bright when there is no silencer...
---Stixsmaster |
Re: Weapon Lights (Beta) * Updated v0.2
Quote:
If you want to keep the use of cvars : - Hook NewRound event ( or others, like RoundStart or RoundEnd ) - Retrieve cvar value, and parse it - Save in global vars. You can create a command acting as cvar, too. When someone change the value, it will save immediately one time in the global vars. Using Cvars, you will have to wait the next event. Do you see what I was meant now ? Quote:
It will be better to not send a lot of messages when the player is not around. Quote:
Quote:
Code:
Code:
Quote:
And Mini_Midget is right, you should use the VEN's method. |
I see code around me in the darkest nights
Hi, I try to implement VEN's method but I can't get it to work.
I'll go insane, I try thousands of ways but it still doesn't work. I tried to implement a way to find if a weapon si silenced with cs_get_weapon_silen() (I don't know how to use offsets), and make a new cvar for it with 3 options: 0 - disable if is silenced 1 - make the light as a normal weapon 2 - make 50% of radius light if is silenced But it fails CATASTROPHiCALLY. If anyone can help me plz, I leave you the code attached (without the silenced option attempts). Thanks and sorry my bad english. Greetings. |
Re: Weapon Lights (Beta) * Updated v0.2
Wait a bit. I will send you by PM the corrected plugin with both cvars and command as examples, so to see the difference. Then, feel free to use or not some code with your own style. ( I don't attach here because some people seem to not like when I rewrite a plugin... -_- )
[Edit] Message sent. I have included your "silenced" cvar too. Hope it will help you. |
All times are GMT -4. The time now is 20:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.