Raised This Month: $ Target: $400
 0% 

Gravity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shibz
Junior Member
Join Date: Apr 2004
Old 06-01-2004 , 23:30   Gravity
Reply With Quote #1

I want to make a plugin so that when you bind a key, and when you hold that key down, whoever you set it to when you bound it flies into the air. I am having trouble getting this to work. Here is what I have...

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> #include <fun> public plugin_init(){     register_plugin("Rockets","0.0.1","Shibz")     register_clcmd("+amx_fly","cmdFly")     register_clcmd("-amx_fly","cmdunFly") } public cmdFly(id,level,cid) {     if (!(get_user_flags(id)&ADMIN_RCON)) {         client_print(id,print_console,"[AMXX] You have no access to that command")         return PLUGIN_HANDLED     }     new arg[32],arg2[3]     read_argv(1,arg,31)     new player = cmd_target(id,arg,5)     if (!player)         return PLUGIN_HANDLED     new sPlayer[2]     sPlayer[0] = player     new victim     set_user_gravity(victim,-1.50)     client_cmd(victim,"+jump;wait;wait;-jump")     return PLUGIN_CONTINUE     new playername[32]     get_user_name(player,playername,31)     return PLUGIN_HANDLED } public cmdunFly(id,level,cid) {     if (!(get_user_flags(id)&ADMIN_RCON)) {         client_print(id,print_console,"[AMXX] You have no access to that command")         return PLUGIN_HANDLED     }     new arg[32],arg2[3]     read_argv(1,arg,31)     new player = cmd_target(id,arg,5)     if (!player)         return PLUGIN_HANDLED     new sPlayer[2]     sPlayer[0] = player     new victim     set_user_gravity(victim,1.00)     client_cmd(victim,"+jump;wait;wait;-jump")     return PLUGIN_CONTINUE     new playername[32]     get_user_name(player,playername,31)     return PLUGIN_HANDLED }

I used Lud's jetpack mod as a reference, and I copied a little... this is only my second plugin.
Shibz is offline
Shibz
Junior Member
Join Date: Apr 2004
Old 06-03-2004 , 08:56  
Reply With Quote #2

*bump* Does anyone know how I can do this? I want it so you bind a key to "+amx_fly playername" so that when you hold that key down, they go up, and when you let go, they go back down.
Shibz is offline
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 06-03-2004 , 08:57  
Reply With Quote #3

use suphero "Superman" as a reference much better.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-03-2004 , 08:59  
Reply With Quote #4

You could try this:
set their gravity to 0.01 and
Code:
#define SPEED 800.0 new upVector[3]; upVector[0] = 0; upVector[1] = SPEED; upVector[2] = 0; entity_set_vector(id, EV_VEC_velocity, upVector);

Should work (this is how i did it in my SuperKeeper plugin)
__________________
hello, i am pm
PM is offline
Shibz
Junior Member
Join Date: Apr 2004
Old 06-03-2004 , 09:12  
Reply With Quote #5

So, is this what it should look like?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> #include <fun> #define SPEED 800.0 public plugin_init(){     register_plugin("Rockets","0.0.1","Shibz")     register_clcmd("+amx_fly","cmdFly")     register_clcmd("-amx_fly","cmdunFly") } public cmdFly(id,level,cid) {     if (!(get_user_flags(id)&ADMIN_RCON)) {         client_print(id,print_console,"[AMXX] You have no access to that command")         return PLUGIN_HANDLED     }     new arg[32],arg2[3]     read_argv(1,arg,31)     new player = cmd_target(id,arg,5)     if (!player)         return PLUGIN_HANDLED     new sPlayer[2]     sPlayer[0] = player     new victim     set_user_gravity(victim,0.01)     new upVector[3];     upVector[0] = 0;     upVector[1] = SPEED;     upVector[2] = 0;     entity_set_vector(id, EV_VEC_velocity, upVector);     client_cmd(victim,"+jump;wait;wait;-jump")     return PLUGIN_HANDLED } public cmdunFly(id,level,cid) {     if (!(get_user_flags(id)&ADMIN_RCON)) {         client_print(id,print_console,"[AMXX] You have no access to that command")         return PLUGIN_HANDLED     }     new arg[32],arg2[3]     read_argv(1,arg,31)     new player = cmd_target(id,arg,5)     if (!player)         return PLUGIN_HANDLED     new sPlayer[2]     sPlayer[0] = player     new victim     set_user_gravity(victim,1.00)     return PLUGIN_HANDLED }

I'm not at home and can't test it out yet...
Shibz is offline
Shibz
Junior Member
Join Date: Apr 2004
Old 06-03-2004 , 23:10  
Reply With Quote #6

Ok, I got my origional thing working... my problem was because I had victem swiched with player. Anyway, now i need to be able to...

1) make it so you can easily navigate in the air, like by somehow making you able to control yourself better while airborne, but only for one player... As a last resort, I would want to make seperate binds for side thrusters and forward/reverse... Can somone plz tell me how to do that?

2) Make your aim better while airborne.

3) Hover when you are in the air.

If anyone could explain this it'd be nice. Thanks.
Shibz is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 06-04-2004 , 06:55  
Reply With Quote #7

for moving in the air.. see my SuperKeeper plugin (search for it).
It is a bit complicated so lemme tell you how i do it:
1) I set their gravity to 0.01, so they don't really move
2) I check their keys, and compute a velocity vector.
3) I set their velocity to the new vector.
Works perfect
__________________
hello, i am pm
PM is offline
Shibz
Junior Member
Join Date: Apr 2004
Old 06-04-2004 , 13:54  
Reply With Quote #8

I used that code that you gave me in that earlier post, and I don't think it worked right... It just draged me in a single direction, no matter what way I was trying to move.
Shibz is offline
Shibz
Junior Member
Join Date: Apr 2004
Old 06-06-2004 , 13:27  
Reply With Quote #9

I looked through that superkeeper plugin and it is WAY over my head. Can somone plz help me?
Shibz is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-07-2004 , 09:15  
Reply With Quote #10

I just use a plugin available for amx right now, and bind it accordingly.

its something like personal gravity or something...
and I just do
alias +fly amx_grav [name] -30
alias -fly amx_grav [name] 100
bind pgup +fly

and thats all there is to it...the plugin even makes them jump...forgot the actual name of the plugin though.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Reply



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 14:38.


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