AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   DeathRun Frostnades (disable traps) (https://forums.alliedmods.net/showthread.php?t=180355)

Schwabba 03-14-2012 14:04

DeathRun Frostnades (disable traps)
 
2 Attachment(s)
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.

http://stuff.pingstars.org/traps.JPG

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

bibu 03-14-2012 14:38

Re: DeathRun Frostnades (disable traps)
 
All

PHP Code:

if(is_user_connected(id) && is_user_alive(id)) 

->

PHP Code:

if(is_user_alive(id)) 


Schwabba 03-14-2012 15:00

Re: DeathRun Frostnades (disable traps)
 
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.

pacheco 03-14-2012 18:24

Re: DeathRun Frostnades (disable traps)
 
Nice work!

DarkGod 03-14-2012 18:38

Re: DeathRun Frostnades (disable traps)
 
Quote:

Originally Posted by Schwabba (Post 1668918)
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.

Schwabba 03-14-2012 23:22

Re: DeathRun Frostnades (disable traps)
 
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.

Devil259 03-15-2012 06:04

Re: DeathRun Frostnades (disable traps)
 
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);
}


jonnzus 03-15-2012 06:20

Re: DeathRun Frostnades (disable traps)
 
Done aldery http://forums.alliedmods.net/showthr...light=deathrun

Schwabba 03-15-2012 07:29

Re: DeathRun Frostnades (disable traps)
 
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.

jonnzus 03-15-2012 07:30

Re: DeathRun Frostnades (disable traps)
 
Ok, well gj:D


All times are GMT -4. The time now is 08:40.

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