Raised This Month: $12 Target: $400
 3% 

Stealthy Snipers


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-03-2018 , 12:32   Stealthy Snipers
Reply With Quote #1

a simple plugin that makes every sniper transparent.
cvars:
sniper_visibility 0-255 // default 100
Attached Files
File Type: sma Get Plugin or Get Source (stealth.sma - 687 views - 827 Bytes)
__________________

Last edited by man_s_our; 04-04-2018 at 18:31.
man_s_our is offline
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 04-04-2018 , 16:12   Re: Stealthy Snipers
Reply With Quote #2

Did it take you 1 min to make this plugin?.

You can optimize it alot.
  1. When buying the item, make them invisible then instead of using prethink.
  2. You are using cstrike for no reason at all.
  3. I would use pdata to get weapon id, or use ham_item_deploy and cache id instead.
  4. You're not checking if player is alive or not.

Or, if you want to make a more simple plugin, use atfp.

Please learn a bit more before posting a plugin.
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 04-04-2018 at 16:15.
SkumTomteN is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-04-2018 , 18:26   Re: Stealthy Snipers
Reply With Quote #3

Quote:
Originally Posted by SkumTomteN View Post
When buying the item, make them invisible then instead of using prethink.
it's possible that the player pickup the sniper or drop it. that's why I used prethink.
__________________
man_s_our is offline
41aaa41
Member
Join Date: Aug 2011
Location: KOCAELİ / TURKEY
Old 06-19-2019 , 09:54   Re: Stealthy Snipers
Reply With Quote #4

Hello
I have a suggestion
I think if Sniperla stays still for three seconds, it'il be invisible.
Which one is invisible.
0 visible = 255 invisible
Thx
note : I am blind person ....
41aaa41 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-19-2019 , 15:12   Re: Stealthy Snipers
Reply With Quote #5

Quote:
Originally Posted by man_s_our View Post
it's possible that the player pickup the sniper or drop it. that's why I used prethink.
There is pick-up and drop events.
__________________
edon1337 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 06-19-2019 , 16:07   Re: Stealthy Snipers
Reply With Quote #6

There is a possibility of player carrying two different snipers. If someone was to drop one sniper out of two or more, plugin would break. So checking if player is currently using sniper is a way better idea.

Last edited by thEsp; 06-19-2019 at 16:11.
thEsp is offline
wilianmaique
BANNED
Join Date: Nov 2016
Old 06-19-2019 , 19:29   Re: Stealthy Snipers
Reply With Quote #7

use CurWeapon better than preThink.

Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "Stealthy Sniper"
#define VERSION "1.0"
#define AUTHOR "man_s_our"

new trans

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	trans = register_cvar("sniper_visibility" , "100")

	register_event("CurWeapon", "xCurWeapon", "be", "1=1")
}

public xCurWeapon(id)
{
	static weapon

	weapon = get_user_weapon(id)

	if(is_user_alive(id) && (weapon == CSW_AWP || weapon == CSW_SG550 || weapon == CSW_SCOUT || weapon == CSW_G3SG1))
		set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(trans))
	else
		set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
}
wilianmaique is offline
Send a message via Skype™ to wilianmaique
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-29-2019 , 12:02   Re: Stealthy Snipers
Reply With Quote #8

As stated before, the code can be improved.

Unapproved because the section needs cleaning. If you decide to improve and add more features, PM me.
__________________
HamletEagle is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 06-29-2019 , 15:01   Re: Stealthy Snipers
Reply With Quote #9

@wilianmaique


Use Ham_Item_Deploy
__________________
simanovich is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode