PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Jop"
#define VERSION "1.0"
#define AUTHOR "Nemesis"
new const P_KNIFE[] = "models/jop2.mdl";
new const V_KNIFE[] = "models/jop.mdl";
new gDamageKafa, gDamageVucut;
public plugin_init() {
new mapname[32];
get_mapname(mapname,31)
if((containi(mapname,"jail") != -1) || (containi(mapname,"jb_") != -1) ) {
register_plugin(PLUGIN, VERSION, AUTHOR)
gDamageKafa = register_cvar("jop_damage_kafa","80.0")
gDamageVucut = register_cvar("jop_damage_vucut","50.0")
register_event("CurWeapon","eCurWeapon","be","1=1")
RegisterHam(Ham_TakeDamage,"player","eTakeDamage",0)
}
}
public plugin_precache() {
precache_model(P_KNIFE)
precache_model(V_KNIFE)
}
public eCurWeapon(id) {
if((get_user_team(id) == 2) && (get_user_weapon(id) == CSW_KNIFE)) {
set_pev(id,pev_viewmodel2,V_KNIFE)
set_pev(id,pev_weaponmodel2,P_KNIFE)
}
}
public eTakeDamage(victim, inflictor, attacker, Float:damage) {
if((get_user_team(attacker) == 2) && (get_user_weapon(attacker) == CSW_KNIFE)) {
if(get_pdata_int(victim,75) == HIT_HEAD) {
SetHamParamFloat(4,get_pcvar_float(gDamageKafa))
}
else {
SetHamParamFloat(4,get_pcvar_float(gDamageVucut))
}
}
}