AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Strip weapons, i dont want c4! (https://forums.alliedmods.net/showthread.php?t=91962)

TitANious 05-08-2009 05:18

Strip weapons, i dont want c4!
 
Hi, im really need a easy stripping method, which strips all just not c4, ive tryed:
PHP Code:

stock drop(id)
{
    
fm_strip_user_weapons(id)
    
fm_set_user_armor(id0)


But that strips c4

Anggara_nothing 05-08-2009 05:34

Re: Strip weapons, i dont want c4!
 
if you using fun module. this is the code:
Quote:

give_item(id, "weapon_c4")
Else if you using fakemeta_util module. this is the code:
Quote:

fm_give_item(id, "weapon_c4")

hleV 05-08-2009 05:45

Re: Strip weapons, i dont want c4!
 
Code:
stock drop(id) {         new bHadBomb;           if (user_has_weapon(id, CSW_C4))                 bUserHadBomb = true;           fm_strip_user_weapon(id)         fm_set_user_armor(id, 0)           if (bHadBomb)                 fm_give_item(id, "weapon_c4"); }

TitANious 05-08-2009 05:55

Re: Strip weapons, i dont want c4!
 
Dosent all get the c4 bomb then?

ConnorMcLeod 05-08-2009 07:20

Re: Strip weapons, i dont want c4!
 
I already gave you a working code...

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define OFFSET_PRIMARYWEAPON    116
#define OFFSET_C4_SLOT        372

StripUserWeapons(id)
{
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT)
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT)
    }

    
strip_user_weapons(id)
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0)

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4))
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent)
        
cs_set_user_bpammo(idCSW_C41)
        
cs_set_user_plant(id1)
    }
    return 
PLUGIN_HANDLED



TitANious 05-08-2009 07:33

Re: Strip weapons, i dont want c4!
 
Shouldnt i stock this?

ConnorMcLeod 05-08-2009 10:06

Re: Strip weapons, i dont want c4!
 
This is a stock.
Just use StripUserWeapons(id) where you need it in your plugin.

TitANious 05-08-2009 13:13

Re: Strip weapons, i dont want c4!
 
I rename it to drop(id) :P Then it allready in my code :D


All times are GMT -4. The time now is 01:30.

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