|
楼主 |
发表于 2005-2-12 14:38:22
|
显示全部楼层
来自 中国–陕西–西安
Post by larnk
fakemeta可能作很多东西的。我原来一直想怎么样让awp不能一枪毙命,结果也是用fakemeta解决的。 Post by A082
能否传一下你的AWP不一枪毙命插件? [PHP]
//////////////////////////////////////////////////////////
////// AWP Damage Reducer 0.11 by XxAvalanchexX
////// Requested by MauS of the AMX Mod X Forums
//////
////// This plugin reduces the amount of damage done by AWPs
////// by making the game think that instead of hitting them
////// in the chest or stomach, they get hit in the arms or
////// legs, thus causing much less damage.
//////
////// Cvars: mp_awpdmgreducer <0|1> (default 1)
////// whether or not to use this plugin
//////////////////////////////////////////////////////////
#include <amxmodx>
#include <engine>
#include <fakemeta>
public plugin_init() {
register_plugin("AWP Damage Reducer","0.11","Avalanche");
register_cvar("mp_awpdmgreducer","1");
register_forward(FM_TraceLine,"fw_traceline",1);
// get name of mod
new modname[32];
get_modname(modname,31);
// if not cstrike
if(!equal(modname,"cstrike")) {
pause("ae"); // lock plugin
}
}
public plugin_modules() {
require_module("FakeMeta");
}
public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id) {
// if cvar is off
if(get_cvar_num("mp_awpdmgreducer") < 1) {
return FMRES_IGNORED;
}
// id could be any entity id, not just a player, so...
if(!is_user_connected(id) || !is_user_alive(id)) {
return FMRES_IGNORED;
}
// get what the traceline hit
new victim = get_tr(TR_pHit);
// once again, victim could be any entity id, not just a player
if(!is_user_connected(victim) || !is_user_alive(victim)) {
return FMRES_IGNORED;
}
// get the weapon goodies
new clip, ammo, weapon = get_user_weapon(id,clip,ammo);
// stop if it is not the AWP or they have no bullets in the clip
if(weapon != CSW_AWP || clip <= 0) {
return FMRES_IGNORED;
}
// get where the bullet hit
new hitplace = get_tr(TR_iHitgroup);
if(hitplace == HIT_CHEST) { // if it hit in chest
set_tr(TR_iHitgroup,random_num(HIT_LEFTARM,HIT_RIGHTARM)); // redirect it an arm
}
else if(hitplace == HIT_STOMACH) { // if hit in stomach
set_tr(TR_iHitgroup,random_num(HIT_LEFTLEG,HIT_RIGHTLEG)); // redirect to a leg
}
return FMRES_IGNORED;
}
[/PHP] |
|