Raised This Month: $32 Target: $400
 8% 

DeathRun Frostnades (disable traps)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Schwabba
Senior Member
Join Date: Apr 2008
Old 03-14-2012 , 14:04   DeathRun Frostnades (disable traps)
Reply With Quote #1

Description:
This plugin allows you to buy Frostnades which disable traps in range of their explosion.
The disabled traps are marked red and the button to this trap can't be used.



How to install
Download the files and put them into the folders:

*\addons\amxmodx\plugins\drfn.amxx
*\addons\amxmodx\data\lang\drfn.txt

Notes
After so many people asked me for that plugin, i decided to make a public version. It uses some default sounds/sprites and is multilingual supported. This plugin also detects func_breakables and make them safe. You can change the Prefix by editing the drfn.sma.

Commands
  • say /fn - Buy Frostnades
  • say_team /fn - Buy Frostnades

CVars
  • drfn_enable (default 1) - toggles the plugin
  • drfn_prize (default 16000) - money you have to pay for Frostnades
  • drfn_amount (default 2) - amount of Frostnades you'll get
  • drfn_radius (default 200.0) - explosion range
  • drfn_time (default 10.0) - traps are disabled for this time in seconds

Credits
XxAvalanchexX - Frostnades idea and some part of the code

Changelog
b1.0 - First release
Attached Files
File Type: txt drfn.txt (799 Bytes, 691 views)
File Type: sma Get Plugin or Get Source (drfn.sma - 1823 views - 9.0 KB)

Last edited by Schwabba; 03-15-2012 at 03:27.
Schwabba is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 03-14-2012 , 14:38   Re: DeathRun Frostnades (disable traps)
Reply With Quote #2

All

PHP Code:
if(is_user_connected(id) && is_user_alive(id)) 
->

PHP Code:
if(is_user_alive(id)) 
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 03-14-2012 , 15:00   Re: DeathRun Frostnades (disable traps)
Reply With Quote #3

Ya.. thought the same till i got multiple server crashes cause i did'nt checked if the player is connected with different plugins.

So i use both for every plugin since i had that problem.
Schwabba is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 03-14-2012 , 18:24   Re: DeathRun Frostnades (disable traps)
Reply With Quote #4

Nice work!
__________________



pacheco is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-14-2012 , 18:38   Re: DeathRun Frostnades (disable traps)
Reply With Quote #5

Quote:
Originally Posted by Schwabba View Post
Ya.. thought the same till i got multiple server crashes cause i did'nt checked if the player is connected with different plugins.

So i use both for every plugin since i had that problem.
is_user_alive() actually checks if the client is connected.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Schwabba
Senior Member
Join Date: Apr 2008
Old 03-14-2012 , 23:22   Re: DeathRun Frostnades (disable traps)
Reply With Quote #6

It should, DarkGod, but i found out that it does'nt work every time. My Servers crashed sometimes with the

PHP Code:
error invalid player X 
debug told me it's the line:

PHP Code:
if(is_user_alive(id)) 
checking if the player is connected fixed that problem.

Last edited by Schwabba; 03-14-2012 at 23:23.
Schwabba is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 03-15-2012 , 06:04   Re: DeathRun Frostnades (disable traps)
Reply With Quote #7

Code:
static cell AMX_NATIVE_CALL is_user_alive(AMX *amx, cell *params) /* 1 param */
{
	int index = params[1];
	
	if (index < 1 || index > gpGlobals->maxClients) // !is_user_connected( index )
	{
		return 0;
	}
	
	CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);

	if (g_bmod_tfc)
	{
		edict_t *e = pPlayer->pEdict;
		if (e->v.flags & FL_SPECTATOR || 
			(!e->v.team || !e->v.playerclass))
		{
			return 0;
		}
	}
	
	return ((pPlayer->ingame && pPlayer->IsAlive()) ? 1 : 0);
}
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 03-15-2012 at 06:05.
Devil259 is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 03-15-2012 , 06:20   Re: DeathRun Frostnades (disable traps)
Reply With Quote #8

Done aldery http://forums.alliedmods.net/showthr...light=deathrun
jonnzus is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 03-15-2012 , 07:29   Re: DeathRun Frostnades (disable traps)
Reply With Quote #9

Scary how similar this plugins are. Complete different coding style, but the result is very similar.

You can't buy a frostnade with his plugin, multi_managers are not detected on his plugin, so it does'nt work on every trap. Also it does'nt detect the whole trap if you just hit a part of it and func_breakables are not detected.

But i like the sound when traps get disabled.

Btw i made that plugin more than 1 year ago, just copied it out of my drmanager.
Schwabba is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 03-15-2012 , 07:30   Re: DeathRun Frostnades (disable traps)
Reply With Quote #10

Ok, well gj
jonnzus 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 04:06.


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