AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Parachute 1.3 (KRoTaL) (https://forums.alliedmods.net/showthread.php?t=49694)

jtp10181 01-10-2007 22:12

Parachute 1.3 (KRoTaL)
 
2 Attachment(s)
This should work on ANY Mod. Let me know if you have problems. Conversion to FAKEMETA will be coming eventually.

Press your +USE Button (defaulted to "e") to use the parachute.

Code:


  Parachute
  Version: 1.3
  Author: KRoTaL/JTP10181
  0.1    Release
  0.1.1  Players can't buy a parachute if they already own one
  0.1.2  Release for AMX MOD X
  0.1.3  Minor changes
  0.1.4  Players lose their parachute if they die
  0.1.5  Added amx_parachute cvar
  0.1.6  Changed set_origin to movetype_follow (you won't see your own parachute)
  0.1.7  Added amx_parachute <name> | admins with admin level a get a free parachute
  0.1.8  JTP - Cleaned up code, fixed runtime error
  1.0    JTP - Should be final version, made it work on basically any mod
  1.1    JTP - Added Changes from AMX Version 0.1.8
              Added say give_parachute and parachute_fallspeed cvar
              Plays the release animation when you touch the ground
              Added chat responder for automatic help
  1.2    JTP - Added cvar to disable the detach animation
              Redid animation code to improve organization
              Force "walk" animation on players when falling
              Change users gravity when falling to avoid choppiness
  1.3    JTP - Upgraded to pCVARs
 
 
  Commands:
 
 say buy_parachute  -  buys a parachute (CStrike ONLY)
 
 saw sell_parachute  -  sells your parachute (75% of the purchase price)
 
 say give_parachute <nick, #userid or @team>  -  gives your parachute to the player
 
 amx_parachute <nick, #userid or @team>  -  gives a player a free parachute (CStrike ONLY)
 
 amx_parachute @all  -  gives everyone a free parachute (CStrike ONLY)
 
  Cvars:
 sv_parachute "1"  - 0: disables the plugin - 1: enables the plugin
 
 parachute_cost "1000"  - cost of the parachute (CStrike ONLY)
 
 parachute_payback "75"  - how many percent of the parachute cost you get when you sell your parachute (ie. (75/100) * 1000 = 750$)
 
 parachute_fallspeed "100" - speed of the fall when you use the parachute


VEN 01-11-2007 09:59

Re: Parachute 1.3 (KRoTaL)
 
Is there any specific reason for not using the PCvar system for all possible cases?

Also instead of reindexing the same array numerous times you could just cache the value of the given array element.

Deviance 01-11-2007 10:05

Re: Parachute 1.3 (KRoTaL)
 
Nice JTP! I was using the old one on my server, so this is perfect :D

Hawk552 01-11-2007 20:26

Re: Parachute 1.3 (KRoTaL)
 
There's no reason to make a fakemeta version. If you really want to, go ahead, but I can't see any reason for it.

Please do as VEN said, but for now I'm approving this.

Arkshine 01-11-2007 21:32

Re: Parachute 1.3 (KRoTaL)
 
1 Attachment(s)
Jtp,

Can you add please this :

- parachute_free <1|0> ; Free Parachute is given to each round on all players.
- parachute_sound <1|0> ; Give the possibility of adding a custom sound when one falls with the parachute (I don't know what is the best way to add a sound easily (define ? file ? cetera) ; also I attach an example)


Thanks in advance :up:

vittu 01-11-2007 23:27

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by arkshine (Post 426125)
Can you add please this :

- parachute_free <1|0> ; Free Parachute is given to each round on all players.

Set parachute_cost to 0 and gives free each spawn. (no need for an extra cvar to give it for free)

Also, admins with correct access level get it free each spawn aswell (though I think this should be optional as well):
#define PARACHUTE_LEVEL ADMIN_LEVEL_A

Trent-Resnor 01-11-2007 23:29

Re: Parachute 1.3 (KRoTaL)
 
Great plugin! +karma

jtp10181 01-11-2007 23:40

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by VEN (Post 425927)
Is there any specific reason for not using the PCvar system for all possible cases?

Also instead of reindexing the same array numerous times you could just cache the value of the given array element.

Don't really know what you are talking about, can you be more specific? Reference line numbers or something.

jim_yang 01-11-2007 23:52

Re: Parachute 1.3 (KRoTaL)
 
i guess he means
Code:

new players[32], num
get_players(players, num)
for(new i; i<num; i++)
{
    get_user_name(players[i], ...)
    get_user_team(players[i], ...)
    get_user_ping(players[i], ...)
}

you can use a variable cache players[i]

vittu 01-12-2007 00:06

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by jim_yang (Post 426178)
i guess he means
Code:

new players[32], num
get_players(players, num)
for(new i; i<num; i++)
{
    get_user_name(players[i], ...)
    get_user_team(players[i], ...)
    get_user_ping(players[i], ...)
}

you can use a variable cache players[i]

Did you even look in the code? I'm sure jtp knows what caching is.

I'm sure ven meant well but I'm guess he only glanced at the code. Seeing as this is completely valid (as it's not used numerous times no reason to cache it):
Code:

                for(new a = 0; a < inum; a++) {
                        has_parachute[players[a]] = true
                }

and the cvars not using pcvar are not the plugins cvars or are string cvars... Unless he means something else that I don't see and as jtp basically said "where?" not what...


All times are GMT -4. The time now is 10:45.

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