No fall dmg

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Locked
User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

No fall dmg

Post by nuodas159 »

Sveiki, gal kas galetu parasyti koda no fall dmg terams? :) +karma
Image


ptaha525
Jau po truputį tampa savu
Posts: 109
Joined: 2011 Dec 14 11:24
Skype: ptaha525
Location: Vilnius
Contact:

Re: No fall dmg

Post by ptaha525 »

no fall dmg terams

Code: Select all

#include <amxmodx>#include <engine>#include <cstrike> #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)   && cs_get_user_team(id) == CS_TEAM_T) {    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))    {    if(falling[id]) {      entity_set_int(id, EV_INT_watertype, -3);    }  }}
Attachments
No_Fall Damage_terrorist.amxx
(1.98 KiB) Downloaded 674 times

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: No fall dmg

Post by newb »

Ir tipo norit pasakyt client_PreThink ir client_PostThink geriau nei Ham_TakeDamage ?

Code: Select all

#include <amxmodx>#include <hamsandwich> public plugin_init() {    RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage")} public hook_TakeDamage(Victim, Inflictor, Attacker) {        if(!Attacker && get_user_team(Victim) == 1)         return HAM_SUPERCEDE        return HAM_IGNORED}
P.S. Gal koki tikrinima praleidau.

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: No fall dmg

Post by nuodas159 »

Delko neveikia? ta prasme nukritus ant zemes vistiek dmg nusijama??
Last edited by nuodas159 on 2012 Mar 13 14:50, edited 1 time in total.
Image

ptaha525
Jau po truputį tampa savu
Posts: 109
Joined: 2011 Dec 14 11:24
Skype: ptaha525
Location: Vilnius
Contact:

Re: No fall dmg

Post by ptaha525 »

nuodas159 wrote:Delko neveikia? ta prasme nukritus ant zemes vistiek dmg nusijama??

Code: Select all

public NoDamage_player ( id, victim, Float:flDamage, Float:fVecDir[ 3 ], tr, damage_type ){    if ( is_user_alive( id ) && iClass[ victim ] == 5 )    {        if ( damage_type & DMG_FALL && get_pcvar_num( g_fall_damage ) ) {            return HAM_SUPERCEDE;        }    }    return HAM_IGNORED;}
tas kur as numeciau tikrinau t nenuema dmg i ct nuema

User avatar
hleV
AMX Mod X ekspertai
Posts: 875
Joined: 2011 Apr 02 11:23
Skype: hlev.lt
Location: Šiauliai

Re: No fall dmg

Post by hleV »

ptaha525 wrote: tas kur as numeciau tikrinau t nenuema dmg i ct nuema
Bet kodas durnas.

Code: Select all

#include <amxmodx>#include <hamsandwich>#include <cstrike>#include <hlsdk_const> public plugin_init()    RegisterHam(Ham_TakeDamage, "player", "OnTakeDmg"); public OnTakeDmg(victim, inflictor, atker, Float:dmg, dmgType)    return (dmgType == DMG_FALL && cs_get_user_team(victim) == CS_TEAM_T) ? HAM_SUPERCEDE : HAM_IGNORED;
Image ← RIP best userbar
DISKUSIJA: KIETAS PLUGIN'O UŽSAKOVAS
Privačios pagalbos neteikiu!

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: No fall dmg

Post by nuodas159 »

Aciu hleV veikia :P. +karma. lock tema :).
Image

Locked

Who is online

Users browsing this forum: No registered users and 3 guests