Raised This Month: $ Target: $400
 0% 

Dropped weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-03-2009 , 17:11   Dropped weapons
Reply With Quote #1

PHP Code:
public rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        
dropPrimaryWeapons(id)
        
dropSecondaryWeapons(id)

        
fm_give_item(id"weapon_usp")
        
fm_give_item(id"weapon_deagle")
        
fm_give_item(id"weapon_ak47")
        
fm_give_item(id"weapon_m4a1")
    }
}

dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)

How do you make all weapons except the usp, deagle, m4a1 and ak47 drop at the start of a new round and stop people from buying anything.
Debesėlis is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-04-2009 , 07:30   Re: Dropped weapons
Reply With Quote #2

up
Debesėlis is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-04-2009 , 08:08   Re: Dropped weapons
Reply With Quote #3

Try this. I know that it is not what you want completely but check if you like it.

PHP Code:
#include <amxmodx>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new rifles_active[33]
new 
HamHook:AddPlayerItemHook

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("rifles","rifles")

    
AddPlayerItemHook RegisterHam(Ham_AddPlayerItem,"player","playerAddItem")
}

public 
playerAddItem(id,itemID)
{
    return 
HAM_SUPERCEDE;
}

public 
rifles(id)
{
    
rifles_active[id] = 1;
    
    if(
rifles_active[id])
    {
        
DisableHamForward(AddPlayerItemHook);
        
        
fm_give_item(id"weapon_usp")
        
fm_give_item(id"weapon_deagle")
        
fm_give_item(id"weapon_ak47")
        
fm_give_item(id"weapon_m4a1")
        
        
EnableHamForward(AddPlayerItemHook);
    }
    
    return 
PLUGIN_HANDLED;

__________________
joaquimandrade is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-04-2009 , 08:48   Re: Dropped weapons
Reply With Quote #4

Thank you, maybe you have some another ideas ?

Last edited by Debesėlis; 06-04-2009 at 08:51.
Debesėlis is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-04-2009 , 09:10   Re: Dropped weapons
Reply With Quote #5

Quote:
Originally Posted by Debesėlis View Post
Thank you, maybe you have some another ideas ?
Tell exactly what you want. Like:

None item/weapon can be bought (That includes armor / defuser)
None weapon can be caught from the floor (There are maps that have weapons on the floor)
__________________
joaquimandrade is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-04-2009 , 10:14   Re: Dropped weapons
Reply With Quote #6

Rifle is one of the functions of admin menu, I turn it on and have the M3 weapon. When I spawn in the next round rifles function give me weapons but the M3 stay, overall player have 3 weapons Ak47, M4A1 and M3 I want that he would have only 2 weapons. I want to strip all weapons of those who give emphasis.

I hope you understand me
Debesėlis is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-04-2009 , 10:23   Re: Dropped weapons
Reply With Quote #7

Quote:
Originally Posted by Debesėlis View Post
Rifle is one of the functions of admin menu, I turn it on and have the M3 weapon. When I spawn in the next round rifles function give me weapons but the M3 stay, overall player have 3 weapons Ak47, M4A1 and M3 I want that he would have only 2 weapons. I want to strip all weapons of those who give emphasis.

I hope you understand me
Sorry but i don't understand what spawn has to do with this.

What you want is the thing from the other thread but with strip instead of drop?
__________________
joaquimandrade is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-04-2009 , 10:34   Re: Dropped weapons
Reply With Quote #8

PHP Code:
dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)

This code is drop weapons. I need to strip all the weapons except c4, m4a1, ak47 and usp.

Debesėlis is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-04-2009 , 10:53   Re: Dropped weapons
Reply With Quote #9

Quote:
Originally Posted by Debesėlis View Post
PHP Code:
dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)

This code is drop weapons. I need to strip all the weapons except c4, m4a1, ak47 and usp.
Tell me one thing.

In this code: http://forums.alliedmods.net/showpos...5&postcount=12

What is missing except the part of changing drop to strip?
__________________
joaquimandrade is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 06-04-2009 , 10:55   Re: Dropped weapons
Reply With Quote #10

block buy weapons on respawn.
Debesėlis 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 13:52.


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