|
Veteran Member
Join Date: Oct 2006
Location: Germany
|

05-19-2009
, 04:37
Re: Strip weapon
|
#2
|
hi....i hope this is what you want
PHP Code:
/*================================================================================
----------------------------------- -*- [ZP] Extra Item : Spartan -*- -----------------------------------
~~~~~~~~~~~~~~~ - Description - ~~~~~~~~~~~~~~~
A Spartan has Multipy Damage x10000.
================================================================================*/ #include <amxmodx> #include <fakemeta> #include <zombieplague> #include <hamsandwich>
#define is_valid_player(%1) (1 <= %1 <= 32)
new g_itemid, pcvar_dmgmultiplier new bool:g_Hasspartan[33]
public plugin_init() { register_plugin("[ZP] Extra: Spartan ( Multipy Damage x10000 )", "1.0", "ƒa†es™") g_itemid = zp_register_extra_item("Spartan ( Multipy Damage x10000 )", 0, ZP_TEAM_HUMAN) pcvar_dmgmultiplier = register_cvar("zp_awp_dmg_multiplier", "10000") RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) register_event("HLTV","new_round", "a","1=0", "2=0") register_forward(FM_ClientConnect, "client_connect") register_forward(FM_ClientDisconnect, "client_disconnect") } public new_round() { for(new i = 0; i < 32; i++) { g_Hasspartan[i] = false } } public client_connect(id) { g_Hasspartan[id] = false } public client_disconnect(id) { g_Hasspartan[id] = false } public Death() { g_Hasspartan[read_data(2)] = false } public fwHamPlayerSpawnPost(id) { g_Hasspartan[id] = false } public zp_user_infected_post(id) { if (zp_get_user_zombie(id)) { g_Hasspartan[id] = false } }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage) { if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_KNIFE && g_Hasspartan[attacker] ) { SetHamParamFloat(4, damage * get_pcvar_float( pcvar_dmgmultiplier ) ) } } public zp_extra_item_selected(id, itemid) { if ( itemid == g_itemid ) { fm_weaponstrip(id, 0) set_pev(id, pev_armorvalue, float(pev(id, pev_armorvalue)) + 1500.0) set_pev(id, pev_health, float(pev(id, pev_health)) + 1500.0) set_pev(id, pev_gravity, float(pev(id, pev_gravity)) + 0.7) fm_user_rendering(id, kRenderFxGlowShell, 225, 0, 0, kRenderNormal, 16) client_print(id, print_chat, "[ZP] You has bought Spartan") g_Hasspartan[id] = true; } } stock fm_weaponstrip(id, noknife=0) { static ent ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip")) if(!pev_valid(ent)) return 0 dllfunc(DLLFunc_Spawn, ent) dllfunc(DLLFunc_Use, ent, id) if(!noknife)fm_give_item(id,"weapon_knife") engfunc(EngFunc_RemoveEntity, ent) return 1 } stock fm_give_item(id, const item[]) { static ent ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item)) if (!pev_valid(ent)) return; static Float:originF[3] pev(id, pev_origin, originF) set_pev(ent, pev_origin, originF) set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN) dllfunc(DLLFunc_Spawn, ent) static save save = pev(ent, pev_solid) dllfunc(DLLFunc_Touch, ent, id) if (pev(ent, pev_solid) != save) return; engfunc(EngFunc_RemoveEntity, ent) } stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) { new Float:RenderColor[3]; RenderColor[0] = float(r); RenderColor[1] = float(g); RenderColor[2] = float(b); set_pev(entity, pev_renderfx, fx); set_pev(entity, pev_rendercolor, RenderColor); set_pev(entity, pev_rendermode, render); set_pev(entity, pev_renderamt, float(amount)); return 1; }
strip user weapons without knife
PHP Code:
fm_weaponstrip(id, 0)
strip user all weapons
PHP Code:
fm_weaponstrip(id, 1)
__________________
Last edited by vato loco [GE-S]; 05-19-2009 at 05:20.
|
|