Raised This Month: $ Target: $400
 0% 

strip weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-28-2009 , 07:51   strip weapons
Reply With Quote #1

How do I get the other weapons removed once these are given? Because when a player has an M3 and is given new weapons on the next round, he still keeps the M3. I need the old weapons the player had removed and only the new ones (also the C4 for T's) given.

PHP Code:
public rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
cs_set_user_defuse(id0)
            
give_item(id"weapon_glock18")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_ak47")
            
give_item(id"weapon_awp")
        }

        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
cs_set_user_defuse(id1)
            
give_item(id"weapon_usp")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_m4a1")
            
give_item(id"weapon_awp")
        }
    }

Debesėlis is offline
31m0_owns
Member
Join Date: May 2008
Location: SLH, New Jersey-- U.S.A
Old 05-28-2009 , 08:07   Re: strip weapons
Reply With Quote #2

PHP Code:
fm_strip_weapon(id); 
this strips all weapons from every player

for t's add

PHP Code:
fm_give_item(player"weapon_c4"
This should fix it. But put the
PHP Code:
fm_strip_weapon(id); 
before the people get the items
__________________
Project(s):
Prop-Hunt: 5%
Killcam: NEVER GOING TO HAPPEN!!!
31m0_owns is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-28-2009 , 08:14   Re: strip weapons
Reply With Quote #3

and every round player has got c4? if all weapons are strippet and givet every round need buy ammo...
Debesėlis is offline
31m0_owns
Member
Join Date: May 2008
Location: SLH, New Jersey-- U.S.A
Old 05-28-2009 , 08:18   Re: strip weapons
Reply With Quote #4

My bad my friend...

PHP Code:
fm_strip_weapon(id);
 
public 
rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
cs_set_user_defuse(id0)
            
give_item(id"weapon_c4")
            
give_item(id"weapon_glock18")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_ak47")
            
give_item(id"weapon_awp")
        }
 
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
cs_set_user_defuse(id1)
            
give_item(id"weapon_usp")
            
give_item(id"weapon_deagle")
            
give_item(id"weapon_m4a1")
            
give_item(id"weapon_awp")
        }
    }

sorry if everything is miss colored i am at my school and they don't have pawn/amxx studio
__________________
Project(s):
Prop-Hunt: 5%
Killcam: NEVER GOING TO HAPPEN!!!
31m0_owns is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-28-2009 , 08:49   Re: strip weapons
Reply With Quote #5

I need strip weapons not for all players! public rifes(id) this is menu item... when it aktive on next round gives some weapons... I want to next spawn from player removes weapons but stay only USP, deagle, m4, awp....
Debesėlis is offline
31m0_owns
Member
Join Date: May 2008
Location: SLH, New Jersey-- U.S.A
Old 05-28-2009 , 08:51   Re: strip weapons
Reply With Quote #6

Putting fm_strip_weapon does remove all weapons but as your code implies that it will give them a new set of guns at the beginning of every round so i see no problem, Thats why fm_strip_weapon is before the guns are distributed
__________________
Project(s):
Prop-Hunt: 5%
Killcam: NEVER GOING TO HAPPEN!!!
31m0_owns is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 05-28-2009 , 08:55   Re: strip weapons
Reply With Quote #7

If you don't want to use FakeMeta just for that then use strip_user_weapons. And also, his code would give all the Terrorists a c4. Is that what you want?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 05-28-2009 , 09:07   Re: strip weapons
Reply With Quote #8

Quote:
Originally Posted by DarkGod View Post
If you don't want to use FakeMeta just for that then use strip_user_weapons. And also, his code would give all the Terrorists a c4. Is that what you want?
strip_user_weapons if use this on every round need buy for all weapons AMMO.
Debesėlis is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-28-2009 , 08:56   Re: strip weapons
Reply With Quote #9

Code:
new CurrentlyHoldedWeaponID; // new CurrentlyHoldedWeaponName[32];   engclient_cmd(id, "slot1");   CurrentlyHoldedWeaponID = get_user_weapon(id); // get_weaponname(CurrentlyHoldedWeaponID, CurrentlyHoldedWeaponName, 31);   if (CurrentlyHoldedWeaponID != CSW_KNIFE) {         fm_strip_user_gun(id, CurrentlyHoldedWeaponID);         // ham_strip_user_weapon(id, CurrentlyHoldedWeaponName);         // engclient_cmd(id, "drop"); }   engclient_cmd(id, "slot2");   if (CurrentlyHoldedWeaponID != CSW_KNIFE) {         fm_strip_user_gun(id, CurrentlyHoldedWeaponID);         // ham_strip_user_weapon(id, CurrentlyHoldedWeaponName);         // engclient_cmd(id, "drop"); }
You could also use pdata with currently active item's offset.
__________________
hleV is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 05-28-2009 , 09:12   Re: strip weapons
Reply With Quote #10

cs_set_user_bpammo(id, CSW_* #)
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Reply


Thread Tools
Display Modes

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:29.


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