Raised This Month: $ Target: $400
 0% 

changing user velocity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kmal2t
BANNED
Join Date: Apr 2006
Old 06-23-2007 , 13:48   Re: changing user velocity
Reply With Quote #6

I didn't give a detailed explanation because I made the assumption you AREN'T stupid and could figure out what I meant. This should work for you fine. the *A* means you are going to have to figure out how to classify your entity since it probably wont be func_wall. You have cvars for how fast (speed), how high you want them (speed_height) and how long you want the boost to last (speed_time).
Code:
#include <amxmodx> #include <fakemeta> new bool:touchENT[33], bool:canSpeed[33]; new Float:veloc1[33][3],Float:veloc2[33][3]; public plugin_init() {     register_plugin("Boost", "1.0", "Skittles");     register_forward(FM_PlayerPreThink, "FM_pthink");     register_forward(FM_Touch, "FM_tch");     register_cvar("speed_height", "100.0");     register_cvar("speed", "1000");     register_cvar("speed_time", "1.0"); } public waiter(id) {     touchENT[id] = false;     canSpeed[id] = true;     set_task(get_cvar_float("speed_time"), "speedOFF", id); } public speedOFF(id) {     canSpeed[id] = false; } public FM_pthink(id) {     if(is_user_alive(id) && !is_user_bot(id)) {         if(touchENT[id]) {             waiter(id);         }         if(canSpeed[id]) {             client_cmd(id, "+jump;wait;-jump");             pev(id, pev_velocity, veloc1[id]);             velocity_by_aim(id, get_cvar_num("speed"), veloc2[id]);             veloc2[id][2] = get_cvar_float("speed_height");             set_pev(id, pev_velocity, veloc2[id])         }     } } public FM_tch(id, Touched) {     if(is_user_alive(id)) {         new class1[32];         pev(Touched, pev_classname, class1, 31);         if(equal(class1, "func_wall")) {    //*A*             touchENT[id] = true;         }     } }

If you want the height to just be normal jump height just remove the speed_height cvar in plugin_init and change
Code:
veloc2[id][2] = get_cvar_float("speed_height");
to
Code:
veloc2[id][2] = veloc1[id][2];

Last edited by kmal2t; 06-23-2007 at 13:54.
kmal2t is offline
 



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 21:33.


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