Raised This Month: $ Target: $400
 0% 

falldamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sn3amtz
Senior Member
Join Date: Jan 2015
Location: France
Old 01-08-2016 , 07:38   falldamage
Reply With Quote #1

After player falls I want to get player falldamage + respawn is possible?

Code:
#include <amxmodx>
#include <engine>

#define FALL_VELOCITY 350.0

public plugin_init() {
  register_plugin("No fall damage", "0.2", "v3x");
  if(!cvar_exists("mp_falldamage")) {
    register_cvar("mp_falldamage", "0");
  }
}

new bool:falling[33];

public client_PreThink(id) {
  if(get_cvar_num("mp_falldamage") == 0 
  && is_user_alive(id) 
  && is_user_connected(id)) {
    if(entity_get_float(id, EV_FL_flFallVelocity) >= FALL_VELOCITY) {
      falling[id] = true;
    } else {
      falling[id] = false;
    }
  }
}

public client_PostThink(id) {
  if(get_cvar_num("mp_falldamage") == 0 
  && is_user_alive(id) 
  && is_user_connected(id)) {
    if(falling[id]) {
      entity_set_int(id, EV_INT_watertype, -3);
    }
  }
}
Sn3amtz 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 09:32.


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