Raised This Month: $ Target: $400
 0% 

Strip weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 05-19-2009 , 01:19   Re: Strip weapon
Reply With Quote #1

I guess nobody knows ?
__________________
ƒa†es™ is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 05-19-2009 , 04:37   Re: Strip weapon
Reply With Quote #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_itemidpcvar_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 )"0ZP_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 
032i++)
    {
        
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(victiminflictorattackerFloat:damage)
{
    if ( 
is_valid_playerattacker ) && get_user_weapon(attacker) == CSW_KNIFE && g_Hasspartan[attacker] )
    {
        
SetHamParamFloat(4damage get_pcvar_floatpcvar_dmgmultiplier ) )
    }
}
public 
zp_extra_item_selected(iditemid)
{
    if ( 
itemid == g_itemid )
    {
        
fm_weaponstrip(id0)
        
set_pev(idpev_armorvaluefloat(pev(idpev_armorvalue)) + 1500.0)
        
set_pev(idpev_healthfloat(pev(idpev_health)) + 1500.0)
        
set_pev(idpev_gravityfloat(pev(idpev_gravity)) + 0.7)
        
fm_user_rendering(idkRenderFxGlowShell22500kRenderNormal16)
        
client_print(idprint_chat"[ZP] You has bought Spartan")
        
g_Hasspartan[id] = true;
    }
}
stock fm_weaponstrip(idnoknife=0)
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"))
    if(!
pev_valid(ent)) return 0
    dllfunc
(DLLFunc_Spawnent)
    
dllfunc(DLLFunc_Useentid)
    if(!
noknife)fm_give_item(id,"weapon_knife")
    
engfunc(EngFunc_RemoveEntityent)
    return 
1
}
stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
    if (!
pev_valid(ent)) return;
    
    static 
Float:originF[3]
    
pev(idpev_originoriginF)
    
set_pev(entpev_originoriginF)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    static 
save
    save 
pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentid)
    if (
pev(entpev_solid) != save)
        return;
    
    
engfunc(EngFunc_RemoveEntityent)
}
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16) {
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);
    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));
    return 
1;

strip user weapons without knife
PHP Code:
fm_weaponstrip(id0
strip user all weapons
PHP Code:
fm_weaponstrip(id1
__________________

Last edited by vato loco [GE-S]; 05-19-2009 at 05:20.
vato loco [GE-S] is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 05-19-2009 , 05:45   Re: Strip weapon
Reply With Quote #3

Quote:
Originally Posted by vato loco [GE-S] View Post
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_itemidpcvar_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 )"0ZP_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 
032i++)
    {
        
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(victiminflictorattackerFloat:damage)
{
    if ( 
is_valid_playerattacker ) && get_user_weapon(attacker) == CSW_KNIFE && g_Hasspartan[attacker] )
    {
        
SetHamParamFloat(4damage get_pcvar_floatpcvar_dmgmultiplier ) )
    }
}
public 
zp_extra_item_selected(iditemid)
{
    if ( 
itemid == g_itemid )
    {
        
fm_weaponstrip(id0)
        
set_pev(idpev_armorvaluefloat(pev(idpev_armorvalue)) + 1500.0)
        
set_pev(idpev_healthfloat(pev(idpev_health)) + 1500.0)
        
set_pev(idpev_gravityfloat(pev(idpev_gravity)) + 0.7)
        
fm_user_rendering(idkRenderFxGlowShell22500kRenderNormal16)
        
client_print(idprint_chat"[ZP] You has bought Spartan")
        
g_Hasspartan[id] = true;
    }
}
stock fm_weaponstrip(idnoknife=0)
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"player_weaponstrip"))
    if(!
pev_valid(ent)) return 0
    dllfunc
(DLLFunc_Spawnent)
    
dllfunc(DLLFunc_Useentid)
    if(!
noknife)fm_give_item(id,"weapon_knife")
    
engfunc(EngFunc_RemoveEntityent)
    return 
1
}
stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
    if (!
pev_valid(ent)) return;
 
    static 
Float:originF[3]
    
pev(idpev_originoriginF)
    
set_pev(entpev_originoriginF)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
 
    static 
save
    save 
pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentid)
    if (
pev(entpev_solid) != save)
        return;
 
    
engfunc(EngFunc_RemoveEntityent)
}
stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16) {
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);
    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));
    return 
1;

strip user weapons without knife
PHP Code:
fm_weaponstrip(id0
strip user all weapons
PHP Code:
fm_weaponstrip(id1
Does this help to prevent the spartan from getting or picking up anymore guns ?
__________________
ƒa†es™ is offline
Old 05-19-2009, 05:59
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ...
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 05-19-2009 , 08:49   Re: Strip weapon
Reply With Quote #5

here add this to your code
prevent weapon pick up if is player g_Hasspartan[id]
and if player buy weapons after strip weapon will be switch automatic to knife
PHP Code:
public plugin_init()
{
    
register_forward(FM_Touch"WeaponTouch")
    
register_event("CurWeapon""ev_CheckWeapon""be""1=1")

PHP Code:
public WeaponTouch(entid)
{
    if (
is_user_alive(id) && g_Hasspartan[id])
    {
        new 
ClassName[32]
        
pev(entpev_classnameClassName31)
        
        if (
equal(ClassName"weaponbox") || equal(ClassName"armoury_entity") || equal(ClassName"grenade"))
            return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED


public 
ev_CheckWeapon(id
{
    static 
weapon_num
    weapon_num 
read_data(2)         
    
    if(
is_user_alive(id) && g_Hasspartan[id]) 
    {
        if(
weapon_num != CSW_KNIFE
        {
            
engclient_cmd(id"weapon_knife")
        }
    }

__________________

Last edited by vato loco [GE-S]; 05-19-2009 at 12:56.
vato loco [GE-S] is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 05-20-2009 , 02:32   Re: Strip weapon
Reply With Quote #6

Thanks you very much
__________________
ƒa†es™ is offline
maoxianxie
Member
Join Date: Aug 2011
Old 09-09-2011 , 23:52   Re: Strip weapon
Reply With Quote #7

How to use fm_weaponstirp
maoxianxie is offline
Reply



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 01:35.


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