Raised This Month: $52 Target: $400
 13% 

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 - 342 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: Traphouse
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.
__________________
Knife Bounty
CS Battle Royale (PUBG)
Contact/Ticket System
Elite Admin System (A better admin system)

I don't sip the lean, used to love codeine cuz I love to dream
edon1337 is offline
Send a message via Skype™ to edon1337
thEsp
Senior Member
Join Date: Aug 2017
Location: Gjilan, Albania
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.
__________________
"If you wanna know what's courage, courage's when you just don't give in. When you fight to the end even though you can't win!"
- Viktor Palokaj (Unikkatil)

"If you judge people, you have no time to love them."
- Anjezë Gonxhe Bojaxhiu (Mother Teresa)

Last edited by thEsp; 06-19-2019 at 16:11.
thEsp is online now
wilianmaique
Member
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)
}
__________________
Everything in life is learned.
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
__________________

I'm awesome, and I realy like cookie.
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 16:29.


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