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...

jim_yang 01-12-2007 00:29

Re: Parachute 1.3 (KRoTaL)
 
i said guess. i didn't see the code before. really sorry for that. after looking the code, i am sure VEN means this para_ent[id]. that's the same effect as the loop i post the example code.

vittu 01-12-2007 00:35

Re: Parachute 1.3 (KRoTaL)
 
Oh in the prethink, yea i didn't look at it that way... good point.

And I guess with the pcvars he meant get_cvar_pointer first, then pcvar get in code?

yaya 03-10-2007 08:58

Re: Parachute 1.3 (KRoTaL)
 
1 Attachment(s)
Hello,
I have a small problem with the plugins parachute, when I use it with the warcraft3FT, race 1 UNDEAD lag, I can't jump any more more high and not to run more quickly.

do you have a solution?

Here plugins

vittu 03-10-2007 13:03

Re: Parachute 1.3 (KRoTaL)
 
1 Attachment(s)
If you want you can see if this makes any difference in performance, I made these changes for a server. Though your issues with gravity (not speed) are because this plugin changes your gravity to act as a parachute. I suppose your gravity value could be stored when you spawn to be used as your normal gravity to reset to. For the time being change weapons and see if that helps, I know it will for speed but I don't recall if gravity is also effected when doing so.

yaya 03-10-2007 17:08

Re: Parachute 1.3 (KRoTaL)
 
I tested your plugins, the problem remains the same one, I cannot jump higher once the parachute is used

vittu 03-10-2007 17:24

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by yaya (Post 451102)
I tested your plugins, the problem remains the same one, I cannot jump higher once the parachute is used

You complained of lag I said try the one I posted to see if it "makes any difference in performance". As it is only an optimization according to VEN's suggestions (and a cvar to disable free parachute for admins, plus fakemeta conversion).

I only gave you the cause and a hint at a fix for your issue with the gravity, not a fixed version for that. And I have no idea why you think speed was effected, since you do not explain yourself very well. I asked you to try changing weapons and you said nothing of the result. I guess I could take a look into wc3ft and see how gravity is being set.

yaya 03-11-2007 05:35

Re: Parachute 1.3 (KRoTaL)
 
sorry i am french i dont all understand, you want sma wrc3?

Arkshine 03-11-2007 08:32

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by vittu
since you do not explain yourself very well

@vittu : What it said is if he selects "undead" race thus he can jump higher and run more quickly, but once he used the parachute he cannot jump any more high nor to run quickly. Just this problem. But I think that you understood.

Quote:

Originally Posted by yaya (Post 451270)
sorry i am french i dont all understand, you want sma wrc3?

@yaya : Ce qu'il te dit, c'est qu'il t'a donné une idée/piste du pourquoi ton problème. Et qu'il n'a aucune idée pourquoi ta vitesse est affectée. Il t'a demandé de changer d'arme et tu lui as répondu que rien n'avait changé. Et dans sa dernière phrase, il dit qu'il devrait jeter un coup d'oeil dans le code de War3ft et voir comment la gravité est définie.

vittu 03-12-2007 02:25

Re: Parachute 1.3 (KRoTaL)
 
1 Attachment(s)
Well it should not effect his speed at all something else might be causing that (and he should just be able to change weapons to get his speed back). And as I said above I could just check the users gravity before setting it for the parachute. And reset it back to the checked gravity after the player is done parachuting, though in doing this could present possible exploits (ie. map sets gravity, use parachute keep newly set gravity until death)

I did take a look in wc3 and gravity is only set on spawn for undead, but the item that you can buy gets set when you buy it (and new spawn if you didn't die), so that could be a problem as well.


Though seeing as he wants it that way I could make it so it does what I said and it should fix his problem for the most part. It's not hard to change, but let me find some free time to do it in while I'm not working on an sh update. I will edit this post and post it here so as not to create a new post for it.



----------------
Edit: Ok try this and see if it helps, it checks/saves your gravity whenever you use the parachute... (also added a check against using parachute in water in this one) Untested but should be fine.

yaya 03-12-2007 06:51

Re: Parachute 1.3 (KRoTaL)
 
ok thx,
I tried to change weapon but the problem is always present, the only solution to recover gravity is to make a frag, but if one uses the parachute again the problem return.

I awaits your news, they are sympathetic with you to look at

yaya 03-15-2007 08:08

Re: Parachute 1.3 (KRoTaL)
 
I test your plugins, but the problem is always present

solid23 03-29-2007 02:21

Re: Parachute 1.3 (KRoTaL)
 
is there a bind i have to do,,because its install correctly but i had another plugin bound to e,, can someone help please

Arkshine 03-29-2007 04:21

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by vittu (Post 451621)
Well it should not effect his speed at all something else might be causing that (and he should just be able to change weapons to get his speed back). And as I said above I could just check the users gravity before setting it for the parachute. And reset it back to the checked gravity after the player is done parachuting, though in doing this could present possible exploits (ie. map sets gravity, use parachute keep newly set gravity until death)

I did take a look in wc3 and gravity is only set on spawn for undead, but the item that you can buy gets set when you buy it (and new spawn if you didn't die), so that could be a problem as well.


Though seeing as he wants it that way I could make it so it does what I said and it should fix his problem for the most part. It's not hard to change, but let me find some free time to do it in while I'm not working on an sh update. I will edit this post and post it here so as not to create a new post for it.



----------------
Edit: Ok try this and see if it helps, it checks/saves your gravity whenever you use the parachute... (also added a check against using parachute in water in this one) Untested but should be fine.

No need to check/save velocity too ?

vittu 03-29-2007 06:08

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by arkshine (Post 458254)
No need to check/save velocity too ?

I don't see how that would be an issue? (unless you know a reason). velocity doesn't effect a clients maxspeed, I mean when your not setting a velocity it will go to norm or whatever it was set at.

Granted I didn't test that one modified for war3ft useage, but it should work. Only other thing i could think of is to try and call the war3ft gravity func with a createforward with a small edit to war3ft (since it can't be used by include)...

Quote:

Originally Posted by solid23 (Post 458237)
is there a bind i have to do,,because its install correctly but i had another plugin bound to e,, can someone help please

what plugin and whats wrong with "use" key?

Arkshine 03-29-2007 08:07

Re: Parachute 1.3 (KRoTaL)
 
@Vittu:

yaya said to me on a french forum that your modification didn't work. So I decided to check myself, and after some test, it works perfectly. ;)

vittu 03-29-2007 21:38

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by arkshine (Post 458288)
@Vittu:

yaya said to me on a french forum that your modification didn't work. So I decided to check myself, and after some test, it works perfectly. ;)

heh, I appreciate the test but then got no clue what his problem is.

FR0NTLINE 04-18-2007 00:33

Re: Parachute 1.3 (KRoTaL)
 
Yo What do i got to do or edit, the sma file to let everyone just have a free parachute 24/7?

vittu 04-18-2007 00:42

Re: Parachute 1.3 (KRoTaL)
 
Please read thread it's only 2 pages: http://forums.alliedmods.net/showthr...168#post426168

FR0NTLINE 04-18-2007 03:24

Re: Parachute 1.3 (KRoTaL)
 
My bad vittu I could of sworn I read all this shit. Good Lookin Out though bud. Thanks.

So this will work in the sma or do i have to put in cvar.
sv_parachute "1" - 0: disables the plugin - 1: enables the plugin

parachute_cost "0" - 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

`666 04-18-2007 09:15

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by vittu (Post 426168)
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

What level for normal player?

Alka 04-18-2007 09:19

Re: Parachute 1.3 (KRoTaL)
 
ADMIN_USER :wink: or ADMIN_ALL ! the same....

`666 04-18-2007 09:22

Re: Parachute 1.3 (KRoTaL)
 
Thanks again Alka! :D

`666 04-18-2007 11:15

Re: Parachute 1.3 (KRoTaL)
 
now it dosent work for admin :S Maybe have to add 2 lines?

#define PARACHUTE_LEVEL ADMIN_LEVEL_A
#define PARACHUTE_LEVEL ADMIN_USER

Alka 04-18-2007 12:18

Re: Parachute 1.3 (KRoTaL)
 
Of course not!You must use one of them... :roll:

`666 04-18-2007 12:31

Re: Parachute 1.3 (KRoTaL)
 
is there any way make it work for admin and normal players? i did try ADMIN_ALL but didnt work.

vittu 04-18-2007 17:54

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by vittu (Post 426168)
Set parachute_cost to 0 and gives free each spawn.

What's so hard to understand, just set the cost to 0 and everyone gets it for free?

`666 04-18-2007 18:29

Re: Parachute 1.3 (KRoTaL)
 
yeh but so don't have to buy it

vittu 04-18-2007 18:31

Re: Parachute 1.3 (KRoTaL)
 
Quote:

Originally Posted by `666 (Post 466948)
yeh but so don't have to buy it

wow just wow...

Quote:

Originally Posted by vittu (Post 426168)
Set parachute_cost to 0 and gives free each spawn.


jarvismacray 07-10-2007 12:27

Re: Parachute 1.3 (KRoTaL)
 
I keep seeing a few people with this error

Quote:

Mod_LoadBrushModel: models/parachute.mdl has wrong version number
why is this happening, i have had them delete and redownload, then delete the model folder then even reinstall and some still can't get into server!!!

Lordi 07-30-2007 16:04

Re: Parachute 1.3 (KRoTaL)
 
Sorry for poor English. Guys, can't find anyone posting this problem, but I have found one. I use War3TFT mod on my server and when Undead gets levitation, you know lower gravity, so when Undead use parachute gravity seems to vanish until next respawn. It's like gravity sets to normal not back to undead gravity. Could you fix that? Thanks in advance!


All times are GMT -4. The time now is 20:46.

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